Hi BrowseUk.....I tried to solve your problem....may be i didn't get the the result exactly as u wanted....i hope my code will help you.
#! /usr/bin/perl use strict; use warnings; use Data::Dumper; my $count= 0; my $i; my %hash=( A=> [], B=> [], C=> [], ); foreach my $key (sort keys %hash){ $count++; for ($i=1;$i<=$count;$i++){ $hash{$key} =$i; } print Dumper \%hash; }
In reply to Re: In-place sort with order assignment
by changma_ha
in thread In-place sort with order assignment
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |