P is for Practical | |
PerlMonks |
Re: eval and trapping bad regexby xtype (Deacon) |
on Feb 21, 2002 at 07:35 UTC ( [id://146719]=note: print w/replies, xml ) | Need Help?? |
See `perldoc -f eval` If there is a syntax error or runtime error, or a die() statement is executed, an undefined value is returned by eval(), and $@ is set to the error message. If there was no error, $@ is guaranteed to be a null string. Beware that using eval() neither silences perl from printing warnings to STDERR, nor does it stuff the text of warning messages into $@. To do either of those, you have to use the $SIG{__WARN__} facility. See warn and the perlvar manpage. -xtype
In Section
Seekers of Perl Wisdom
|
|