Aren't the following functionally equivalent,Technically, no. [sort @array]->[0]; does return a single element. @{[sort @array]}[0]; however is a slice with one element. I would have expected it to warn - just as @array[0] will warn. The PC way to write it is:
print ${[sort @array]}[0];
In reply to Re^6: Why does 'print shift sort @array' not work?
by JavaFan
in thread Why does 'print shift sort @array' not work?
by pat_mc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |