One approach is to locally change the SIG handler
my $result; { my $flag; local $SIG{__WARN__} = sub { # catch error in @_, set $flag }; $result = int($x); something_different($x,$result) if $flag; }
See Perl's Warn and Die Signals for a general discussion.
HTH! :)
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
In reply to Re: How to capture the "isn't numeric" warning?
by LanX
in thread How to capture the "isn't numeric" warning?
by harangzsolt33
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |