in reply to USE, but fail nicely

try: eval 'use Time::HiRes qw(time)';

The eval {}; form actually tokenizes what is inside the brackets and thus the parser will catch use, no, BEGIN {}, and END{} pragmas and blocks. The string form is just a string till the eval actually happens at runtime.

Try these at the commandline to see the various behaviors:

perl -e 'if(shift){eval{BEGIN{print"eek\n"}print"ahh\n"}}' 0 perl -e 'if(shift){eval{BEGIN{print"eek\n"}print"ahh\n"}}' 1 perl -e 'if(shift){eval"BEGIN{print\"eek\n\"}print\"ahh\n\""}' 0 perl -e 'if(shift){eval"BEGIN{print\"eek\n\"}print\"ahh\n\""}' 1

--
$you = new YOU;
honk() if $you->love(perl)