Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: reading two files in parallel

by moritz (Cardinal)
on May 02, 2013 at 10:17 UTC ( #1031724=note: print w/ replies, xml ) Need Help??


in reply to reading two files in parallel

Something like this?

while (1) { my $a = <F1> or last; my $b = <F2> or last; # use $a and $b here }


Comment on Re: reading two files in parallel
Download Code
Replies are listed 'Best First'.
Re^2: reading two files in parallel
by morgon (Deacon) on May 02, 2013 at 14:49 UTC
    This is a nice way to do it, however I would alaways advice against using $a and $b as variable names as they are "magic" names for sorts and bugs where your variables are then shadowed in a sort can be hard to track down, so better avoid potentially troublesome names.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (16)
As of 2015-07-28 20:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (258 votes), past polls