On Tue, 15 Mar 2005 02:29:06 +0800, John W. Krahn <[EMAIL PROTECTED]> wrote:
Edward Wijaya wrote:
[snip]
## BTW I can just do my other funky stuff here right?Here is one way to do it:
my %files; for ( @ARGV ) { next unless /(.+)\.(?:fa|rs)$/; push @{ $files{ $1 } }, $_; }
for my $base ( keys %files ) { if ( @{ $files{ $base } } != 2 ) { warn "Error: only one file '@{$files{$base}}'.\n"; next; } die "Cannot open files '@{$files{$base}}'.\n" unless open F, '<', $files{ $base }[ 0 ] and open G, '<', $files{ $base }[ 1 ]; print "$base\n>\n"; while ( my $f = <F> and my $g = <G> ) { # LINE 32 print $f + $g, "\n";
} }
John,
I encounter this error:
"
Value of <HANDLE> construct can be "0"; test with defined() at thecode.pl line 32.
thecode.pl syntax OK "
What could be the problem? Thanks so much for your time.
-- Edward WIJAYA Singapore
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>