Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Render numeric sequence as array of letters (index sort + slice)

by tye (Sage)
on May 19, 2003 at 21:21 UTC ( [id://259298]=note: print w/replies, xml ) Need Help??


in reply to Render numeric sequence as array of letters

Try:

my @data= ( 5, 100, 2, 8, 40 ); my @indices= sort { $data[$a] <=> $data[$b] } 0..$#data; my @letters; @letters[@indices]= ('A'..'Z'); print "@letters\n";
so long as you don't have more than 26 numbers.

                - tye

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2024-03-28 13:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found