Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: PGA Golf, Round 1

by jorg (Friar)
on May 24, 2001 at 19:15 UTC ( #82943=note: print w/replies, xml ) Need Help??


in reply to PGA Golf, Round 1

right let's kick things off here... Here is my first Hole, 25chars, took me approx 25 minutes. Makes me wonder if i should've used a Wood number 3 rather than the Iron number 5
sub a{($_[0]=~/\w+/g)[4]}
Update mincus pointed out to me that there are only 18 chars i should count. How's that for a caddy !

Jorg

"Do or do not, there is no try" -- Yoda

Replies are listed 'Best First'.
Re: Re: PGA Golf, Round 1
by danger (Priest) on May 24, 2001 at 19:26 UTC

    According to the counting rules (rule 1 above) you only count the characters inside the subroutine block (for one liners you count the whole command line). So yours is 18 chars.

    Not to spoil anyone's fun, but here's a small tip for shaving characters --- use pop rather than $_[0], that gives us a 16 character solution:

    sub S {(pop=~/\w+/g)[4]} 123456789_123456 # 16

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://82943]
help
Chatterbox?
[Corion]: A good daypart!
Corion feels slightly bad for initiating a discussion yesterday and then running away. I guess I should write that up as a meditation or SoPW
[Corion]: Not the "running away" part but the question+ discussion about IO-less HTTP modules
[Corion]: (or how/where to patch AnyEvent::HTTP or LWP::UserAgent to take control of both the callstack and the data transfer)

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2016-12-08 08:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (137 votes). Check out past polls.