in reply to A "strange" behaviour, at least to me :)
Perl is mis-parsing the line :
as# 2 @values = sort arraynosort(Values=>\@orig_values);
and using the "arraynosort" as a Sort sub.@values = (sort arraynosort 'Values', \@orig_values);
Adding parens fixes it:
An alternative fix is to give "sort" an empty "block", because it wants one:@values = sort (arraynosort(Values=>\@orig_values));
@values = sort {},arraynosort(Values=>\@orig_values);
"I'm fairly sure if they took porn off the Internet, there'd only be one website left, and it'd be called 'Bring Back the Porn!'"
-- Dr. Cox, Scrubs
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: A "strange" behaviour, at least to me :)
by ikegami (Patriarch) on Apr 13, 2013 at 17:36 UTC |
In Section
Seekers of Perl Wisdom