No I wrote new version^^ thx for suggestion
#!/usr/bin/perl use warnings; use strict; use Net::POP3; use Tie::File; use Term::ReadKey; tie my @file, "Tie::File", "dane"; if ($#file != 1){ print "Write pop3 server adress:\n"; chomp($file[0] = <STDIN>); print "Write login:\n"; chomp($file[1] = <STDIN>); } my $time = scalar localtime; my ($msg, $msgnum); print "Write password:\n"; ReadMode 4; chomp(my $key = <STDIN>); ReadMode 0; my $pop = Net::POP3->new($file[0]); my $res = $pop->login($file[1], $key); if ($res){ print"Connect!\nOn $time e-mail status inbox: $res post \n"; } else { print "Couldn't connect $!\n"; exitl } while($res){ do{ do{ print "Write id(number) email to read subject:\n"; chomp($msgnum = <STDIN>); next if $msgnum !~ /\d/; } while ($msgnum > $res); $msg = $pop->get($msgnum); for my $line ( @$msg ) { if( $line =~ /^Subject:(.*)/ ) { print "Subject is:\n $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 ) { print ++$nline,'>', $_; } } elsif ($ans =~ /n/i){ } else { print "Bad!\n"; } } } $pop->quit();
I wait for next suggestion;p what do think about many account??

In reply to Re^3: POP3 client - end by w3b
in thread POP3 client - end by w3b

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.