in reply to Re: First attempt at bringing in file for input/output
in thread First attempt at bringing in file for input/output
Although operator precedence will do the right thing in your code ..
I prefer the more explicitopen 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.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: $!";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: First attempt at bringing in file for input/output
by Your Mother (Archbishop) on Oct 21, 2018 at 17:25 UTC | |
Re^3: First attempt at bringing in file for input/output
by Marshall (Canon) on Oct 22, 2018 at 00:01 UTC |