my $pop = Net::POP3->new($params{server}) or die $!; my $msg_nums = $pop->login($params{user}, $params{pwd}); if ($msg_nums > 0) { ### E-Mail enthalten ###    my $msgnums = $pop->list; # hashref of msgnum => size    foreach my $msgnum (sort{$a <=> $b} keys %$msgnums){ my $lines = join("",@{$pop->get($msgnum)});      my ($head,$body) = split(/\n\s+?\n/,$lines,2);      my @headlines = split(/\n/,$head);      my ($subject,$from);      foreach(@headlines){        $subject = $1 if($_ =~ m/Subject:\s+?(.+)/i);        $from = $1 if($_ =~ m/From:\s+?(.+)/i);      }  } } else{ print "Keine E-Mails"; }