sort treats the first parameter specially if it looks like a function name. It uses the function by the specified name as the compare function during sorting. You can use a unary-+ to disambiguate.
@livesys = sort +Con::liveones;
is the same
@livesys = sort { $a cmp $b } Con::liveones;
with no lost efficiency.
It's no better and no worse than
@livesys = sort &Con::liveones;
Both are better than
@livesys = sort @{[Con::liveones]};
In reply to Re: Dropping the ampersand
by ikegami
in thread Dropping the ampersand
by throop
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |