#!/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 eq "undef"){ print "Couldn't connect $!\n"; exit; } else { print "On $time e-mail status inbox: $res post \n"; } print "Write id(number) email to read:\n"; chomp(my $msgnum = ); my $msg = $pop->get($msgnum); if($msg =~ /Subject:(.*)From:/){ #I think that there is a error here print "Subject is $1"; } $pop->quit();