Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: understanding eval in HPOJ

by broquaint (Abbot)
on Apr 04, 2004 at 21:37 UTC ( [id://342520]=note: print w/replies, xml ) Need Help??


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)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://342520]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2024-04-20 05:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found