file problem

Discussion in 'Programming' started by ssimon171078, Jan 10, 2010.

  1. #1
    problem is to write to file email.txt what i see in print @$msg ;
    i write a code:
    
    
          #!/usr/bin/perl -w
          use Net::POP3;
          open (SALES ,">> email.txt");
        $pop = Net::POP3->new('pop.mail.ru');
    
        if ($pop->login('user', 'pass') > 0) {
          my $msgnums = $pop->list; # hashref of msgnum => size
          foreach my $msgnum (keys %$msgnums) {
             $msg = $pop->get($msgnum);
             print @$msg ;
            $pop->delete($msgnum);
               
                }
        }
    
        $pop->quit;
       close SALES;
    
    
    
    Code (markup):

     
    ssimon171078, Jan 10, 2010 IP
  2. Kaizoku

    Kaizoku Well-Known Member

    Messages:
    1,261
    Likes Received:
    20
    Best Answers:
    1
    Trophy Points:
    105
    #2
    I think you have to do a join; since you want to write all elements?
     
    Kaizoku, Jan 12, 2010 IP