in reply to To use do or eval
So that will run the code from the database and warn if there are any errors when it's run.my $code = $dbh->selectrow_array($sql) or warn "no code - ", $dbh->errstr; do { eval($code); $@ } or warn "broken code - $@";
_________
broquaint
update: as sauoq rightly points out below, my code was b0rken (I was under the impression eval returned the value of $@, how silly of me) it's now been fixed with a do block hack
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: To use do or eval
by sauoq (Abbot) on Jun 03, 2003 at 18:46 UTC |