Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^4: "last expression" quiz

by halley (Prior)
on Oct 20, 2005 at 14:08 UTC ( [id://501673]=note: print w/replies, xml ) Need Help??


in reply to Re^3: "last expression" quiz
in thread "last expression" quiz

Okay, I figured it was some peephole optimization thing. This is not what I would have predicted for deparse output, but it kind of makes sense.
$ perl -MO=Deparse -e 'sub foo { 1 for 1 } foo' sub foo { foreach $_ (1) { '???'; } } foo ; -e syntax OK
The '???' appears for other constants, with which it would generate "useless use of constant in void context" warnings. This warning is suppressed for a few common constants. So I guess the opcode optimizer just forgets WHAT constant was there.

--
[ e d @ h a l l e y . c c ]

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-25 13:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found