http://qs321.pair.com?node_id=1104410


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 http://golf.shinh.org/p.rb?hello+hello+world 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:

"@{[zero,one,two,three,four,five]}[3,1,4,1,5]"
has the result "three one four one five".