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
|
---|
In Section
Seekers of Perl Wisdom