SPUG: interesting while() behavior and hosting recs

Yitzchak Scott-Thoennes sthoenna at efn.org
Sun Oct 3 05:34:20 CDT 2004

On Fri, Oct 01, 2004 at 01:39:01PM -0700, "DeRykus, Charles E" wrote:
> >> As indicated on a man-page somewhere,
> >> those ??? marks indicate that the actual values provided at 
> >> those locations are irrelevant, because "c" will be the result of this application of the comma operator.
> Gawd, you're good if you found that somewhere in the man pages somewhere.

$ man B::Deparse|fgrep -C3 '???'
               if (($var & 0)) {
                   print('Gimme an A!')
               (print(($which ? $a : $b)), '???');
               (($name = $ENV{'USER'}) or '???')

           which probably isn't what you intended (the '???' is a sign that
           perl optimized away a constant value).

       -P  Disable prototype checking. With this option, all function calls
               values include 0, 1, 42, '', 'foo', and 'Useless use of con-
               stant omitted' (which may need to be -sv"'Useless use of con-
               stant omitted'."  or something similar depending on your
               shell). The default is '???'.  If you're using B::Deparse on a
               module or other file that's require'd, you shouldn't use a
               value that evaluates to false, since the customary true con-
               stant at the end of a module will be in void context when the
           produced is already ordinary Perl which shouldn't be filtered

       o   Optimised away statements are rendered as '???'. This includes
           statements that have a compile-time side-effect, such as the

Note that the '???' is a default and can be overridden:

$ perl -MO=Deparse,-sv'"what do you get if you multiply 6 by 9".' -e42
"what do you get if you multiply 6 by 9";
-e syntax OK

More information about the spug-list mailing list