in reply to Checking the success of eval
print "Surprise!\n" if (!defined(eval { $num++; return 1;})); #or (equivalent) print "Surprise!\n" if (!defined(eval { $num++; 1;})); [download]
all you need to do is return a value and you're ok.
cLive ;-)