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 ( #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
Node Status?
node history
Node Type: note [id://212698]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2020-01-21 05:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?