in reply to Re: Re: Re: Re: sort array by value in it
in thread sort array by value in it
Now we are not mind readers and we do not have crystal balls. You are going to need to apply these techniques to your own code and modify accordingly. It would be nearly impossible to give you full blown working code with what little you have provided.for my $host ( keys %space ) { my @data; for ( split /\n/ , $space{$host} ) { next if /^host:volume/; my @field = $_ =~ /^([^:]+):([^\s]+)\s+(\d+)\s+(\d+)/; push @data, \@field; } for ( sort { $data[$a]->[2] <=> $data[$b]->[2] } 0 .. $#data ) { print join "\t" , @{ $data[$_] }; print "\n"; } }
Cheers - L~R
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: sort array by value in it
by demerphq (Chancellor) on May 04, 2004 at 20:08 UTC | |
by Limbic~Region (Chancellor) on May 04, 2004 at 20:33 UTC | |
by demerphq (Chancellor) on May 05, 2004 at 07:15 UTC |