Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: In-place sort with order assignment

by changma_ha (Sexton)
on Sep 20, 2010 at 04:48 UTC ( [id://860761]=note: print w/replies, xml ) Need Help??


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; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://860761]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-25 10:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found