http://www.perlmonks.org?node_id=568505


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.