Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: Best method to order a hash of arraysby xicheng (Sexton) |
on May 16, 2007 at 00:38 UTC ( [id://615666]=note: print w/replies, xml ) | Need Help?? |
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
In Section
Seekers of Perl Wisdom
|
|