Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: sorting based on a list

by SilverB1rd (Scribe)
on May 09, 2001 at 18:20 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://79094]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (7)
As of 2024-03-29 11:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found