#!perl use strict; use warnings; my @handles; my $i = 0; for (@ARGV) { open $handles[$i++], '<', $_ or die "Failed to open $_: $!\n"; } my $line; $i = 0; while (1) { $line = <$handles[$i]>; defined($line) or last; print $line; } continue { ++$i; $i %= @handles; } close $_ for @handles;
In reply to Re: Merging 3 files
by CombatSquirrel
in thread Merging 3 files
by xg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |