Example:
Not the most elegant.. but it works, and you'd likely be able to explain how it works to another person.
#!/usr/bin/perl
my $a = "";
my $b = "";
open FILEA, "%26lt;a" or die $!;
open FILEB, "%26lt;b" or die $!;
open FILEC, "%26gt;c" or die $!;
do {
$a = getc(FILEA);
if ( defined $a ) { print FILEC $a; }
$b = getc(FILEB);
if ( defined $b ) { print FILEC $b; }
} while ( defined $a || defined $b );
close FILEA;
close FILEB;
close FILEC;
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment