in reply to ??? how to print only one line
in thread a few basic questions

In the spirit of TMTOWTDITDUG, here's my idea:

#!/usr/bin/perl -w use strict; my ($fh1, $fh2); open $fh1, "file1.dat" or die "I no read file 1.\n"; open $fh2, "file2.dat" or die "I no read file 2.\n"; my $mainfh = $fh1; while (<$mainfh>) { print; $mainfh = ($mainfh == $fh1) ? $fh2 : $fh1; }
file1.dat:
I'm sure this
file2.dat:
pretty that works.
And finally, output:
I'm pretty sure that this works.

His Royal Cheeziness