Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Sorting a subset

by tcf22 (Priest)
on Dec 12, 2003 at 18:52 UTC ( [id://314383]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @array = qw(Art bob joe andy willy Andrew john Archie);
    foreach(sort {substr($a,1) cmp substr($b,1)} grep /^A/, @array){
    ...
    Andrew
    Archie
    Art
    
  2. or download this
    foreach(sort {substr($a,1) cmp substr($b,1)} grep {substr($_,0,1) eq '
    +A'} @array)
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-04-26 04:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found