in reply to ??? how to print only one line
in thread a few basic questions
In the spirit of TMTOWTDITDUG, here's my idea:
file1.dat:#!/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; }
file2.dat:I'm sure this
And finally, output:pretty that works.
I'm pretty sure that this works.
His Royal Cheeziness
|
|---|