in reply to Re: Almost success
in thread Almost success

Thank you very very much^^ now my script looks nice^^ Here is source:
#!/usr/bin/perl use warnings; use strict; use Net::POP3; my $time = scalar localtime; my $pop3 = "pop3.poczta.onet.pl"; my $login = "haptor\@op.pl"; my $pass = "******************"; my $pop = Net::POP3->new($pop3); my $res = $pop->login($login, $pass); if ($res){ print"On $time e-mail status inbox: $res post \n"; } else { print "Couldn't connect $!\n"; exit; } my $msg; my $msgnum; do{ print "Write id(number) email to read subject:\n"; chomp($msgnum = <STDIN>); } while($msgnum > $res); $msg = $pop->get($msgnum); for my $line ( @$msg ) { if( $line =~ /^Subject:(.*)/ ) { print "Subject is $1\n"; last } } print "Read e-mail? [y/n]\n"; chomp(my $ans = <STDIN>); if ($ans =~ /y/i){ while( my $line = shift @$msg ) { last while $line =~ /^Status:/; } my $nline = 0; for( @$msg ) { $nline += 1; print "$nline> $_"; } } elsif ($ans =~ /n/i){ exit; } else { print "Bad!"; exit; } $pop->quit();
If somebody use this scripts i'll be very happy^^ i love Perl;p