w3b has asked for the wisdom of the Perl Monks concerning the following question:

Hello Dear Monks.
I wrote a short scripts to check last e-mail subject, and if subject start ' and end ' than script will do this in terminal. It's not safe, now... But what is my problem? I want to refresh e-mail status(inbox) without exit from loop I want to do many commands via e-mail without restart script:P Thx
#!/usr/bin/perl use warnings; use strict; use Net::POP3; my $pop3 = "pop3.***.*****.**"; my $login = "****\@***"; my $pass = "***********"; my $pop = Net::POP3->new($pop3); my $res = $pop->login($login, $pass); if ($res){ print"Connect!\nE-mail status inbox: $res post \n"; } else { print "Couldn't connect $!\n"; exit } my ($msg, $msgnums, $ni); #problem while($res){ $msgnums = $pop->last; if ($ni < $msgnums){ $msg = $pop->get($msgnums); foreach my $line ( @$msg ) { if($line =~ /^Subject: '(.*)'/ ) { system(`$1`); $ni = $msgnums; next } } } } #end of problem

jdporter moved from Snippets, per consideration by spiritway: "Move to SoPW?"
Keep: 1, Edit: 13, Reap: 3.