in reply to understanding eval in HPOJ

What odd code - the first eval will always produce an error e.g
$ perl -le 'eval q[exit $?0]; print $@' Number found where operator expected at (eval 1) line 1, near "$?0" (Missing operator before 0?) syntax error at (eval 1) line 1, near "$?0"
So the second eval will never get used, and even if it did, that would also bail out (although, rather frighteningly, it's valid perl code; indirect object syntax is to blame :/) e.g
$ perl -le 'eval q[exec env LANG=C $0 ${1+"$@"}]; print $@;' Can't call method "C" without a package or object reference at (eval 1 +) line 1.
From here it looks like some seriously fruity mix of shell and perl that can never work. However your second concotion looks far more likely to succeed.
HTH

_________
broquaint

update: tidied up second code example and added side note that it actually compiles (ick)