in reply to File handles - there must be a better way

You could eliminate the Cish for loop if you don't need the index into @InHandles.

for my $file ( @InHandles ) { ... }

Update: Quite right, Tux. Missed the initial grab of the first file handle.

--MidLifeXis

Replies are listed 'Best First'.
Re^2: File handles - there must be a better way
by Tux (Canon) on May 13, 2013 at 17:10 UTC

    Only if he replaces the first line with

    my $file1 = shift @InHandles;

    Enjoy, Have FUN! H.Merijn
Re^2: File handles - there must be a better way
by AnomalousMonk (Archbishop) on May 13, 2013 at 19:52 UTC

    Or, keeping the index 0 assignment (array  @InHandles is not changed – might need it later?):

    my $file1 = $InHandles[0]; ... for my $fh (@InHandles[ 1 .. $#InHandles ]) { ... }