SPUG: interesting while() behavior and hosting recs

Tim Maher tim at consultix-inc.com
Fri Oct 1 15:45:39 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.

It's at the end of the following snippet from the Deparse man page;
Enjoy! 8-}


       B::Deparse - Perl compiler backend to produce perl code

       perl -MO=Deparse[,-d][,-fFILE][,-p][,-q][,-l]
               [,-sLETTERS][,-xLEVEL] prog.pl

. . .
       -p  Print extra parentheses. Without this option,
           B::Deparse includes parentheses in its output only
           when they are needed, based on the structure of your
           program. With -p, it uses parentheses (almost) when­
           ever they would be legal. This can be useful if you
           are used to LISP, or if you want to see how perl
           parses your input. If you say

               if ($var & 0x7f == 65) {print "Gimme an A!"}
               print ($which ? $a : $b), "\n";
               $name = $ENV{USER} or "Bob";

           "B::Deparse,-p" will print

               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).

More information about the spug-list mailing list