in reply to Re: CGI Error Handling
in thread CGI Error Handling
I like the idea of putting code in eval-blocks, but is this also efficient/state-of-the-art/perlish?
instead ofeval { open(FH, $file) or die "NO_OPEN"; $text = join('', <FH>) or die "NO_READ"; close(FH) or die "NO_CLOSE"; } if ($@) { ... }
What approach do you find better?open(FH, $file) or &error("NO_OPEN", $file, $!); my $text = join('', <FH>) or &error("NO_READ", $file, $!); close(FH) or &error("NO_CLOSE", $file, $!);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: CGI Error Handling
by chromatic (Archbishop) on Dec 11, 2001 at 02:02 UTC | |
Re: Re: Re: CGI Error Handling
by edebill (Scribe) on Dec 11, 2001 at 10:10 UTC |
In Section
Seekers of Perl Wisdom