Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: [perlre/perlgolf] Golf this: return -1 or return +1 on regexp subroutine please

by petral (Curate)
on Nov 13, 2002 at 21:10 UTC ( [id://212698]=note: print w/replies, xml ) Need Help??


in reply to [perlre/perlgolf] Golf this: return -1 or return +1 on regexp subroutine please

Wierdly enough, this works (67)
sub by_priority { ($a cmp$b,grep$_,map$b=~/$_/-$a=~/$_/,FAQ,SERVICE,ORGANIZATION)[-1] }
Thanks to hints from a golfer who plays the pro circuit.

  p
  • Comment on Re: [perlre/perlgolf] Golf this: return -1 or return +1 on regexp subroutine please
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-19 07:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found