--- "Keith C. Ivey" <[EMAIL PROTECTED]> wrote:
> 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.

I knew there was an option for that, but a quick scan through 
perlvar didn't find it. I assumed I was halucinating, and so 
I plodded on without!

> 2. Use a punctuation variable (like $,) instead of $s, so that
>    you don't have to use the braces when interpolating.

I tried that with one punctuation variable, but it didn't work, 
it appears that assignment to it refused to accept strings, so 
I plodded on without!

> 3. Get rid of the parens around '0..98' (you'll need a space
>    before it, though).

Aha, now that was one I wasn't conscious of.

That's cool. Thanks Keith!


Phil

=====
When inserting a CD, hold down shift to stop the AutoRun feature
In the Device Manager, disable the SbcpHid device.
http://www.cs.princeton.edu/~jhalderm/cd3/

__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

Reply via email to