in reply to __DIE__ easy CGI question

I'm not sure if a __DIE__ handler is the best way to go. I would use an eval block to trap the die. Something like this:
eval { $sqlquery = "SOME UPDATE STATEMENT"; my $newsth = $dbh->prepare($sqlquery); $newsth->execute or die "3"; }; print $query->redirect(-location=>"$redirecturl?error=$@") if $@;
When the die is called, the eval block will exit and $@ will be set to "3". If there is no error, then $@ will be set to the empty string.

If I were a terrorist I'd mainly be afraid of polar bears. Because at the moment, I'm mainly afraid of polar bears, and I can't really see why that would change.
- slashdot