Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: sorting based on a list

by SilverB1rd (Scribe)
on May 09, 2001 at 18:20 UTC ( #79094=note: print w/replies, xml ) Need Help??


in reply to sorting based on a list

I would suggest using a hash for that. You can then sort the hash or pull the words out by letter.
my %foo = { 'a' => 'alpha', 'b' => 'bravo', 'c' => 'charlie'}; foreach $x (sort(keys(%foo))) { print $foo{$x}\n; } print $foo{'b'},$foo{'a'},$foo{'c'};


------
The Price of Freedom is Eternal Vigilance

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2019-02-19 06:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I use postfix dereferencing ...









    Results (101 votes). Check out past polls.

    Notices?