Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Lost hash values

by tlm (Prior)
on May 16, 2005 at 23:37 UTC ( [id://457606]=note: print w/replies, xml ) Need Help??


in reply to Lost hash values

FWIW, your script works fine for me.

I noticed that your printout does not match what your script is doing. For example, in your code, the print out should have the word "is", but this is not what the output shows; and the code prints a newline after "ms", but this does not show in the output. It would help to see the code that actually produces the output.

the lowliest monk

Replies are listed 'Best First'.
Lost hash values
by stephen_isa (Initiate) on May 17, 2005 at 17:20 UTC
    My previous replies were hidden. One has to click on the 2nd "reply4" in this thread and then reply7 to see the fix: BTW, I am new to this posting, how to aviod this? Anyway, here is the final script:
    #!/usr/bin/perl -w open FILE1,"out.prod1" or die "Cannot open file $!"; @rec=<FILE1>; $first=undef; %save=(); foreach $x (@rec){ chomp $x; if ( $x =~ /2005/ ){ $first=$x; if(!defined $save{$first}){ $save{$first}=undef;} } if ( $x =~ /time/ ){ $lat=$x; $lat =~ s/.*?time=(\d+)\.\sms$/$1/; if( $lat > "10" ){ $save{$first}=$lat; } } } foreach $first (sort keys %save){ if ($save{$first}){ print "$first $save{$first}\n"; } }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://457606]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-19 22:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found