in reply to Having trouble porting code between systems.
So, replace the line with any of
@arr = sort{ ${ $a }{"tag"} <=> ${ $b }{"tag"} } @arr; @arr = sort{ $$a{"tag"} <=> $$b{"tag"} } @arr; @arr = sort { $a->{tag} <=> $b->{tag} } @arr;
Update: Interestingly, the old syntax will start working in the recent Perl versions again, because %{ $a }{tag} will return both the string "tag" and its corresponding value, but <=> enforces scalar context to its arguments, so only the last one will be used, i.e. the value of the tag.
|
|---|