Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: Perl Idioms Explained - ${\$obj->method} and @{[sort @list]}

by ambrus (Abbot)
on Oct 20, 2014 at 10:47 UTC ( #1104410=note: print w/replies, xml ) Need Help??

in reply to Perl Idioms Explained - ${\$obj->method} and @{[sort @list]}

I've just seen a variant of this operator, the twin baby cart, "@{[...]}[...]" come up in golf. The original context is the golf task where it's used by the winner perl entries by tails and tybalt89.

This combines list slice indexing with interpolation of the baby cart operator, and is particularly useful because the array interpolation makes sure spaces (the default value of $") are added between the items. An example is:

has the result "three one four one five".

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2020-08-13 06:36 GMT
Find Nodes?
    Voting Booth?
    Which rocket would you take to Mars?

    Results (69 votes). Check out past polls.