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

Re: Fastest I/O possible?

by mordibity (Acolyte)
on Aug 23, 2002 at 14:38 UTC ( [id://192342]=note: print w/replies, xml ) Need Help??


in reply to Fastest I/O possible?

Well, this is pretty miniscule, but you did ask -- you could initialize vars outside of your loop (especially for @fields) to avoid destroying/creating a new variable each time; also, I think handling split() a fixed string '|' instead of a regex might be optimized further:
my ($file, $line, @fields); foreach $file (@files) { open(FILE, $file) or die "Nya, nya: $!\n"; while($line = <FILE>) { @fields = split('|', $line); print OUTPUT join("|", @fields); } }

Log In?
Username:
Password:

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

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

    No recent polls found