First, @$foo is an arrayref, not a hashref. You can make it seem like a hashref by the @{$foo} thingies.

Second, just do this.

my @bar = sort{@{$foo->{$a}} cmp @{$foo->{$b}}} @$foo;

I might be wrong on this because I am not too familiar in the area, please point it out to me if I am. Thank you.

UPDATE:jeffa has pointed out to me how I could fix this...
my @bar = sort{$foo->{$a} cmp $foo->{$b}} @$foo;
$_.=($=+(6<<1));print(chr(my$a=$_));$^H=$_+$_;$_=$^H; print chr($_-39); # Easy but its ok.

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

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