Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Regular expressions and sort

by Perl Mouse (Chaplain)
on Nov 04, 2005 at 14:31 UTC ( [id://505712]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        $am = $1 if $_[0] =~ /$mask/;
        $bm = $1 if $_[1] =~ /$mask/;
    
  2. or download this
        ($am, $bm) = map {/$mask/ ? $1 : 0} @_;
    
  3. or download this
    @result = map {substr $_, 2}
              sort
              map {sprint "%02d%s", (/$mask/ ? $1 : 0), $_} @f;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-03-28 14:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found