Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: Re^2: The High Price of Golf, and A Surprise

by broquaint (Abbot)
on Sep 07, 2002 at 17:04 UTC ( #195883=note: print w/replies, xml ) Need Help??

in reply to Re^2: The High Price of Golf, and A Surprise
in thread The High Price of Golf, and A Surprise

Small note which makes no difference to the deparsed syntax is that sort() used in a void context is a no-op (sp?). So all those sort()s could be deparsed down to
$ perl -MO=Deparse,x7 -e'sort { $b <=> $a } @x' -e syntax OK


Replies are listed 'Best First'.
Re^4: The High Price of Golf, and A Surprise
by Aristotle (Chancellor) on Sep 07, 2002 at 18:27 UTC
    The output would have been empty then; it is apparently not considered a NOP either:
    $ perl -MO=Deparse,x7 -e'1;' '???'; -e syntax OK
    ('???' is what B::Deparse produces when something gets optimized away.) I'm guessing that's because a sort may have side effects f.ex with tied arrays or inside the callback (if there is one), or something to that effect.

    Makeshifts last the longest.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://195883]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2022-09-27 17:14 GMT
Find Nodes?
    Voting Booth?
    I prefer my indexes to start at:

    Results (122 votes). Check out past polls.