Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Using more than one filehandle

by jdporter (Paladin)
on Mar 24, 2004 at 14:38 UTC ( [id://339407]=note: print w/replies, xml ) Need Help??


in reply to Using more than one filehandle

There is nothing to it. Two files, two filehandles. For example:

my $filename1 = "f1.txt"; my $filename2 = "f2.txt"; open F1, "< $filename1" or die "read $filename1"; open F2, "< $filename2" or die "read $filename2"; # assuming the files are exactly parallel, line for line: while (<F1>) { my $line1 = $_; my $line2 = <F2>; # etc. } close F1; close F2;

jdporter
The 6th Rule of Perl Club is -- There is no Rule #6.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (1)
As of 2024-04-25 01:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found