Ok, thank you much.

Teddy

----- Original Message ----- 
From: "Chris Charley" <[EMAIL PROTECTED]>
To: <beginners@perl.org>
Sent: Monday, May 09, 2005 11:07 PM
Subject: Re: sorting a hash


> Hi Teddy
>
> This works :-)
>
> for (sort byname keys %$ref) {
>  print "$_ has the name $ref->{$_}{name} and has $ref->{$_}{age} years\n";
> }
> sub byname {
>  {$ref->{$a}{name} cmp $ref->{$b}{name}}
> }
>
> Chris
>
>
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to