Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: reading two files in parallel

by Laurent_R (Abbot)
on May 02, 2013 at 11:57 UTC ( #1031741=note: print w/replies, xml ) Need Help??


in reply to reading two files in parallel

Nested loops will not give you what you need. Besides Moritz's solution, you could also use one loop on one of the files (but not on the other):

while (my $a = <F1>) { my $b = <F2>; # do something with $a and $b }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1031741]
help
Chatterbox?
Discipulus there are none so deaf as those who will not hear..
Discipulus who do not want to ear
[Corion]: marto: No, I haven't seen anything either and I'm not sure if learning-by- osmosis will work here
[marto]: I've experienced the behavior LanX described, outsourcing really opens your eyes to the situation :)
[Discipulus]: ;=)

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2017-03-30 07:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (353 votes). Check out past polls.