Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Re: Re: Sorting a subset

by tcf22 (Priest)
on Dec 12, 2003 at 19:47 UTC ( #314389=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Sorting a subset
in thread Sorting a subset

Yep. The below code outputs the same result.
my @array = &filter(qw(Art bob joe andy willy Andrew john Archie)); print "$_\n" for(@array); sub filter(){ return sort {substr($a,1) cmp substr($b,1)} grep {substr($_,0,1) e +q 'A'} @_; }

- Tom

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2020-06-03 06:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?



    Results (21 votes). Check out past polls.

    Notices?