Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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 meditating upon the Monastery: (9)
As of 2015-07-02 06:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (30 votes), past polls