Home  |  Linux  | Mysql  | PHP  | XML
From:daem0nb0y@yahoo.com Date:Thu Jul  2 15:12:55 2009
Subject:sorting anonymous arrays inside arrays
Hi,

If I have a loop that for each run creates

while (<FILE>){



Normally, if I only want to sort $myhash through it's values, I would do something like:

foreach (sort { $a <=> $b } keys %myhash){

print "$myhash{$_}\n";

}


what if i want to sort the anonymous hash $myhash{$mykey}-> through it's value. In my first loop above, each key of %myhash has a value of an anonymous hash. The key for this anonymous hash is called 'subkey'. the value of course is $value. I want to sort this anonymous hash by $value.

Any idea how to do that?


      
Navigate in group perl.beginners at sever nntp.perl.org
Previous Next


Your recent visits
Re: Showing errors with user input
Re: [PHP-WIN] problem with PEAR , windows platform , php 5.2.9-2 , IIS Version 6
Re: Cannot update null values into ase using AseCommand
Re: [PHP] generally, where in cPanel can one set the default page to load?
Zend_execute.lo causing Out Of Memory error during compile


  
© No Copyright
You are free to use Anything
Site Maintained by Zareef Ahmed
Powered By PHP Consultants