in reply to (Golf) Friday Golf: Print Formatted Sequence of Digits

22, you probably want to count the -l though, so 23.
# 1234567890123456789012 perl -le'$#=" %03g";print 2..20'
Why are we obscuring golf solutions?

Makeshifts last the longest.

Replies are listed 'Best First'.
Re: Re: (Golf) Friday Golf: Print Formatted Sequence of Digits
by sauoq (Abbot) on Aug 14, 2003 at 19:38 UTC

    Nice. Except for that leading space in the output... Still, you get an upvote from me.

    Update: Of course, you can fix the leading space with "$#="%03g " instead. I can't tell if the example output had a space on the end, so we'd have to let that slide, I guess. (BrowserUk's has a space on the end too, afterall.) That just leaves us with the fact that $# is deprecated. It works... for now. :-)

    -sauoq
    "My two cents aren't worth a dime.";