Although operator precedence will do the right thing in your code ..
open my $FH_infile, '<', "$in_file" or die "Can't open $in_file";
open my $FH_outfile, '>', "$out_file" or die "Can't open $out_file";
I prefer the more explicit
open ( my $FH_infile, '<', "$in_file" ) or
die "Can't open $in_file";
open ( my $FH_outfile, '>', "$out_file" ) or
die "Can't open $out_file";
In addition, I do like to give myself as much information as possible by adding
$! to error messages:
open ( my $FH_infile, '<', "$in_file" ) or
die "Can't open $in_file: $!";
open ( my $FH_outfile, '>', "$out_file" ) or
die "Can't open $out_file: $!";
Also, I wasn't aware of
File::Basename .. that's pretty handy.
Alex / talexb / Toronto
Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.