En op 22 oktober 2002 sprak Gareth McCaughan:
> What's particularly embarrassing is that I *tested* it.
> How could that possibly have worked, I hear you ask?
> Simple. Excerpt from my little test program:
>
> print subst("$2, $1 and $3"), "\n";
My fault. I cut and pasted the original problem
On Mon, Oct 21, 2002 at 05:14:49PM +1000, Andrew Savige wrote:
>
> It may be too soon to start golfing this, but a more normal
> interpretation of (-ugene's brilliancy is something like:
>
> sub subst{join'',map--$|?$_:eval,split/(\$\d+)/,$_[$|=0]}
>
> if you allow the subroutine to mangle $| (ad
On Monday 21 October 2002 7:56 pm, you wrote:
> En op 21 oktober 2002 sprak Gareth McCaughan:
> > I'm feeling very dim. What's wrong with the much simpler
> >
> > sub subst { (my $a=shift) =~ s/\$\d+/eval$&/eg; $a; }
>
> You have to replace '$1' by the actual value of $1. If you try that
> with
En op 21 oktober 2002 sprak Geoff Hubbard:
> Anything wrong with:
>
> sub subst{eval"\"$_[0]\""}
1) It has 3 too many strokes: eval"\"@_\""
2) It mangles $x say, in original string. As stated in original
specification (in Note: line at end), it should not do that.
/-\
http://careers.yahoo.c
En op zeventien oktober tweeduizendtwee sprak (-ugene:
> So what rule are they using to score their solutions?
I don't know. The arbiter in this game is mjd and he has yet to
deliver a verdict. If I were arbiter, however, I would declare the
winner without hesitation as Eugene van der Pijll, with (
En op 21 oktober 2002 sprak Gareth McCaughan:
> I'm feeling very dim. What's wrong with the much simpler
>
> sub subst { (my $a=shift) =~ s/\$\d+/eval$&/eg; $a; }
You have to replace '$1' by the actual value of $1. If you try that with
a regex, $1 is changed. In your case, $1 (and $2, $3 etc.
On Thu, 17 Oct 2002, Eugene van der Pijll wrote:
> It's possible to have fun with Perl outside of golfing (or so I've been
> told). So what rule are they using to score their solutions?
I think the whole point is not the scoring, but the discussion over the
possible solutions, their benefits and
On Thu, Oct 17, 2002 at 10:43:08PM +0200, Eugene van der Pijll wrote:
> It's possible to have fun with Perl outside of golfing (or so I've been
> told). So what rule are they using to score their solutions?
Maybe... *shudder* they're not scored!?
Pom
En op zeventien oktober tweeduizendtwee sprak Andrew Savige:
> mjd has started a new perl-qotw mailing list:
> http://archive.develooper.com/fwp@;perl.org/msg02705.html
> The quizzes on this list might provide some interesting golfing,
> but I'm unsure if golfers are welcome there
Repost the int