Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: What I Most Recently Learned in Perl, But Should Have Already Known

by Hue-Bond (Priest)
on Aug 21, 2006 at 10:55 UTC ( [id://568505]=note: print w/replies, xml ) Need Help??


in reply to Re: What I Most Recently Learned in Perl, But Should Have Already Known
in thread What I Most Recently Learned in Perl, But Should Have Already Known

perl -MO=Deparse -e ' print "true" if 1'

If we do if 0 something even funnier happens:

$ /usr/bin/perl -MO=Deparse -e 'print "true" if 0' '???';

But which is most amusing is the fact that the deparsed code generates a warning:

$ /usr/bin/perl -w -e 'print "true" if 0' $ /usr/bin/perl -w -e '"???"' Useless use of a constant in void context at -e line 1.

--
David Serrano

Replies are listed 'Best First'.
Re^3: What I Most Recently Learned in Perl, But Should Have Already Known
by pKai (Priest) on Aug 23, 2006 at 09:36 UTC

    '???' actually is no real thing. It's more like Deparse saying, this should be optimized away.

    E. g. every "Useless use of a constant in void context" also results in this.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-18 05:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found