in reply to Re: returns not working
in thread returns not working
if ( CheckDeployed( $currentid ) == 0) { # do something }
sub CheckDeployed { #chomp (my $id = $_); my $id = shift; my $deployedcounter = 0; foreach (@deployeduid) { #chomp $_; if ( $id eq $_ ) { print "I found $id in the deployedfile with the timestamp of $de +ployedtimestamp[$deployedcounter]\n"; my $temptime = time; my $comparetime = ($temptime - 86400 * 3); if ($deployedtimestamp[$deployedcounter] < $comparetime) { my $oldtime = $deployedtimestamp[$deployedcounter]; chomp ($deployedtimestamp[$deployedcounter] = $temptime); print TEMPDEPLOYED "$id $deployedtimestamp[$deployedcounte +r] 2\n" or die $!; return "0"; } else { chomp $deployedtimestamp[$deployedcounter]; print TEMPDEPLOYED "$id $deployedtimestamp[$deployedcounte +r] 1\n" or die $!; return 1; } $deployedcounter++; } elsif ( $_ ne "" ) { #reserved } $deployedcounter++ } my $temptime = time; chomp ($deployedtimestamp[$deployedcounter] = $temptime); print TEMPDEPLOYED "$id $deployedtimestamp[$deployedcounter] 1\n +" or die $!; return "2"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: returns not working
by chromatic (Archbishop) on Aug 24, 2005 at 17:47 UTC |