in reply to Checking the success of eval

But you answered your own question (in a way :)
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 ;-)