in reply to Pseudo-hash intrusion...

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};