Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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

by broquaint (Abbot)
on Sep 07, 2002 at 17:04 UTC ( [id://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

_________
broquaint

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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-03-28 14:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found