(-ugene sprak:
> Andrew Savige schreef:
> > Aristotle golfed: 
> > >     $_=$x;@lines=(/^.*/mg)x+length;
> > 
> > Against my better judgment, I will have a go at golfing this:
> > 
> > $_=$x;@l=(/^.*/mg)x/./s
> 
> This clobbers $_. Not nice for the rest of the program. Correct is:
> 
>   {local$_=$x;@l=(/^.*/mg)x/./s}
> 
> or
> 
>   @l=(/^.*/mg)x/./sfor$x

In case anyone is unaware of (-ugene's status in world golf, you can
find out by typing in Eugene van der Pijll at www.googlism.com.

> Unfortunately, you had "use strict" in your first post, and neither
> of these are use-strict safe.

Yeah, I changed the rules for the golf. These seem the two shortest
so far.

@l=(/^.*/mg)x/./sfor$x;
@l=split/^/,$x;chomp@l;

I find this one amusing for some reason:

@l=(('!')x!s!!$x!,(m!^.*!mg)x!!y!!!c)

/-\


http://greetings.yahoo.com.au - Yahoo! Greetings
- Send some online love this Valentine's Day.

Reply via email to