neutron has asked for the wisdom of the Perl Monks concerning the following question:
My question is ... why? Doesn't this take more work (ie for perl, longer runtime)? I suppose if you put an or, it'll simply skip over it if successful and cost nothing extra. Is this correct? Finally, is this good practice when developing code (error tracking) or do most include even in the final draft.my $output_file = 'hoser.txt'; # using three argument form and die if there's an error open my $fh, '>', $output_file or die "$output_file: open(w) failed: + $!"; my @file_info = stat $fh; or die "$output_file: stat failed: $! +"; close $fh or die "$output_file: close(w) failed
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: file test operations
by Corion (Patriarch) on Feb 02, 2009 at 13:11 UTC | |
|
Re: file test operations
by jethro (Monsignor) on Feb 02, 2009 at 14:40 UTC | |
|
Re: file test operations
by JavaFan (Canon) on Feb 02, 2009 at 13:26 UTC | |
|
Re: file test operations
by ikegami (Patriarch) on Feb 02, 2009 at 13:25 UTC | |
|
Re: file test operations
by Bloodnok (Vicar) on Feb 02, 2009 at 13:21 UTC | |
|
Re: file test operations
by apl (Monsignor) on Feb 02, 2009 at 15:22 UTC | |
|
Re: file test operations
by linuxer (Curate) on Feb 02, 2009 at 16:58 UTC | |
|
Re: file test operations
by neutron (Sexton) on Feb 02, 2009 at 16:55 UTC | |
by jethro (Monsignor) on Feb 03, 2009 at 14:40 UTC |