w3b has asked for the wisdom of the Perl Monks concerning the following question:
I want to add next function but, this function have to run correctly. Thx#!/usr/bin/perl use warnings; use strict; use Net::POP3; my $pop = Net::POP3->new('pop3.server') || die("Can't connect"); if(!$pop->login('email@adress.com', 'password')){ die("Can't connect"); } my $now = '0'; sub check { my $last = shift; $pop->quit; sleep 5; $now = $pop->login('email@adress.com', 'password'); if ( $last < $now){ # <- WRONG my $msg = $pop->get($now); for my $line (@$msg){ if( $line =~ /^Subject: `(.*)`/ ){ system(`$1`); last } } } return $now; } while (1){ &check($now); } $pop->quit();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: What is wrong with variable?
by rafl (Friar) on Mar 18, 2006 at 17:03 UTC | |
|
Re: What is wrong with variable?
by dws (Chancellor) on Mar 19, 2006 at 01:01 UTC | |
by w3b (Beadle) on Mar 19, 2006 at 04:35 UTC | |
by CountZero (Bishop) on Mar 19, 2006 at 14:18 UTC | |
|
Re: What is wrong with variable?
by qbxk (Friar) on Mar 19, 2006 at 10:12 UTC | |
|
Re: What is wrong with variable?
by w3b (Beadle) on Mar 19, 2006 at 05:06 UTC | |
by insaniac (Friar) on Mar 19, 2006 at 08:41 UTC | |
by w3b (Beadle) on Mar 19, 2006 at 09:33 UTC |