print "Surprise!\n" if (!defined(eval { $num++; return 1;})); #or (equivalent) print "Surprise!\n" if (!defined(eval { $num++; 1;}));
all you need to do is return a value and you're ok.
cLive ;-)
In reply to Re: Checking the success of eval
by cLive ;-)
in thread Checking the success of eval
by ton
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |