Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 ( #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


Comment on Re^2: What I Most Recently Learned in Perl, But Should Have Already Known
Select or Download Code
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
Node Status?
node history
Node Type: note [id://568505]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2014-10-25 07:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (142 votes), past polls