Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Best method to order a hash of arrays

by xicheng (Sexton)
on May 16, 2007 at 00:38 UTC ( [id://615666]=note: print w/replies, xml ) Need Help??


in reply to Best method to order a hash of arrays

You probably can try just one-dimentional array and then split each element on the fly. not sure about the trade-off, but it's much easier for me to maintain. :-)
my @user_types =(
     '037 => member',
     '165 => public',
     '022 => staff',
     '683 => babe',
     '001 => old fart',
);
foreach my $option (@user_types) 
{
   my ($user, $type) = split /\s*=>\s*/, $option;
   make_option($user, $type);
}
Regards,
Xicheng
  • Comment on Re: Best method to order a hash of arrays

Log In?
Username:
Password:

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

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

    No recent polls found