I got this to work fine under 5.6. It will not work under 5.004. My guess is that something is not as you think it is, are you using strict?
use strict; my $foo = [ {blah=>'aaa'},{blah=>'ddd'},{blah=>'ccc'} ]; my $sortfunc = sub { $a->{blah} cmp $b->{blah} }; my @arr = sort $sortfunc @$foo;
For 5.004 you'd have to:
my @arr = do {local *sortfunc = $sortfunc; sort sortfunc @$foo};

In reply to Re: Pseudo-hash intrusion... by runrig
in thread Pseudo-hash intrusion... by dragonchild

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":