open(FILE_A, "< file_a.txt") or die "Cannot open file_a: $!\n"; open(FILE_B, "< file_b.txt") or die "Cannot open file_b: $!\n"; while (1) { my $line_a = <FILE_A>; my $line_b = <FILE_B>; last if not defined $line_a or not defined $line_b; # Processing of $line_a and $line_b... } close(FILE_A); close(FILE_B);
Arjen
In reply to Re: Using more than one filehandle
by Aragorn
in thread Using more than one filehandle
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |