in reply to data concatenation in an output file

Print the first two lines of a file only if you are in the first file.
if ($. <= 2){ if ($infile eq $FILES[0]){ print OUTFILE $line; } } else { print OUTFILE $line; }

Replies are listed 'Best First'.
Re^2: data concatenation in an output file
by GrandFather (Saint) on Jan 25, 2008 at 15:20 UTC

    or you could reduce the clutter a little by:

    print OUTFILE $line unless $. <= 2 and $infile ne $FILES[0];

    Perl is environmentally friendly - it saves trees