in reply to In-place sort with order assignment
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; }
|
|---|