Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: read a file twice...

by Chmrr (Vicar)
on Apr 15, 2002 at 03:58 UTC ( [id://159087]=note: print w/replies, xml ) Need Help??


in reply to read a file twice...

You can "read" it as many times as you want if you stuff it into an array just once:

open F, "some_file" or die $!"; my @lines = <F>; close F; for (@lines) { # .. find the max and minimum } for (@lines) { # .. do something before / after those indexes }

Update: Oops. s/\@f/\@lines/g; as MeowChow pointed out to me.

perl -pe '"I lo*`+$^X$\"$]!$/"=~m%(.*)%s;$_=$1;y^`+*^e v^#$&V"+@( NO CARRIER'

Log In?
Username:
Password:

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

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

    No recent polls found