Re: Linus sequence
[email protected] ("Keith C. Ivey") Thu, 18 Dec 2003 22:20:50 -0500
| Newsgroups | perl.golf |
|---|---|
| Message-ID | <[email protected]> |
Phil Carmody <[email protected]> wrote: > perl -e > '"${s}1_${s}2"=~/(.*)\1_.*?(.*)\2$/,print$s.=1+(length$1>length$ > 2),$/for(0..98)' > Anyone got a few pointers for improving it? A few easy points (total savings of 7): 1. Use 'perl -le' and eliminate the ',$/' to get the newline. 2. Use a punctuation variable (like $,) instead of $s, so that you don't have to use the braces when interpolating. 3. Get rid of the parens around '0..98' (you'll need a space before it, though). -- Keith C. Ivey <[email protected]> Washington, DC