Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Re: "Countdown" (golf)

by blakem (Monsignor)
on Dec 01, 2001 at 14:56 UTC ( [id://128852]=note: print w/replies, xml ) Need Help??


in reply to Re: "Countdown" (golf)
in thread "Countdown" (golf)

If you reverse the order of the arguments you can use pop instead of shift to save two strokes....

Update:

This attempt is about the same length, though a few chars shorter in the actual -e argument. BTW, yours was a very *evil* script... unbalanced brackets in the -e of a -n? I didn't even realize that was legal, let alone useful! ;-)

perl -aF// -ne'INIT{$l=pop}$L=$l.$/;$L=~s/$_// or$#F=0 for@F;$w[@F].=" +@F"}{print$w[-1]'

-Blake

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-03-29 11:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found