stephen_isa has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w open FILE1,"out.prod" or die "Cannot open file $!"; @rec=<FILE1>; %save=(); foreach $x (@rec){ if ( $x =~ /2005/ ){ chomp($first=$x); $save{$first}=undef;} if ( $x =~ /time/ ){ chomp($lat= $x); $lat =~ s/.*?time=(\d+)\.\sms$/$1/; if( $lat > "10" ){ $save{$first}=$lat; #print "$first is $save{$first}\n"; } } } foreach $first (sort keys %save){ if ($save{$first}){ print "$first is $save{$first} ms.\n"; } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Lost hash values
by Transient (Hermit) on May 16, 2005 at 20:18 UTC | |
by stephen_isa (Initiate) on May 16, 2005 at 20:54 UTC | |
| |
Re: Lost hash values
by tlm (Prior) on May 16, 2005 at 23:37 UTC | |
by stephen_isa (Initiate) on May 17, 2005 at 17:20 UTC | |
Re: Lost hash values
by TheStudent (Scribe) on May 16, 2005 at 23:40 UTC | |
by stephen_isa (Initiate) on May 17, 2005 at 17:25 UTC |