[plug] perl question
Colin Muller
colin at twobluedots.com.au
Tue Aug 20 10:56:42 WST 2002
On Tue, Aug 20, 2002 at 10:34:25AM +0800, Patrick Tehvand wrote:
> in the main.cgi script:
> <snip>
> require "locked.cgi";
use die instead of exit, and test with eval, which allows you to carry
on despite the die. Simple illustration and test case:
##################
in main.cgi:
require 'die.cgi';
my $result;
eval { &myexit };
if ($@) {
print "got error: $@\n";
} else {
print "got no error\n";
}
print "Carrying on, error or not ...\n";
####################
in die.cgi:
sub myexit {
die;
}
1;
Colin
More information about the plug
mailing list