[EMAIL PROTECTED] wrote:
> hi!
> 
> I need to organize a list of values i a hash, but i don't know how.
> 
> ex:
> 
> my %urls;
> 
> $urls{uol} = 1;
> $urls{aol} = 2;
> $urls{txt} = 3;
> 
> ## if i use this:
> 
> @num = sort keys(%url};
> 
> foreach $number(@num) {
>    print $number."\n";
> }

try:
foreach my $MyKey (sort {$urls{$a} <=> $urls{$b} } keys %urls) {
    printf "%3d %s\n",
                            $urls{$MyKey},
                            $MyKey;
   }

Output:
  1 uol
  2 aol
  3 txt

WAGs ;)

> 
> ## I have this output:
> 
> aol
> txt
> uol
> 
> ## how i can organize the values and print the values hash "key",
> with this output (sorted by hash values):
> 
> 1 uol
> 2 aol
> 3 txt
> 
> thank's
> 
> Atenciosamente,
> 
> Márcio Oliveira
> LPIC-1
> 
> 
> _______________________________________________
> Perl-Unix-Users mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



*******************************************************
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
*******************************************************


_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to