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

Re (tilly) 2: TIMTOWTDI/golf - counting backwards

by tilly (Archbishop)
on Jan 28, 2002 at 22:05 UTC ( [id://142133]=note: print w/replies, xml ) Need Help??


in reply to Re: TIMTOWTDI/golf - counting backwards
in thread TIMTOWTDI/golf - counting backwards

Hrm, and I didn't get any notice for having another solution that is as short as your function, and having one that is 1 better on the command line?

Guess I will have to improve then.

#23456789_123456789_123456789_12345 perl -le'$x=@_=a..j;print$x--for@_' sub f { #23456789_123456789_12345678 $x=@_=a..j;print$x--.$/for@_ }
UPDATE
The answer to the question is "tradition". :-)

UPDATE 2
jmcnamara pointed out that I was miscounting. Fixed.

Replies are listed 'Best First'.
Re: Re (tilly) 2: TIMTOWTDI/golf - counting backwards
by Juerd (Abbot) on Jan 28, 2002 at 22:34 UTC
    The sub more or less made me assume it takes parameters. Why do you write it as a sub when it works perfectly on its own?

    2;0 juerd@ouranos:~$ perl -e'undef christmas' Segmentation fault 2;139 juerd@ouranos:~$

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-19 13:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found