Re: New Perl Quiz of the Week mailing list perl-qotw
[email protected] (Gareth McCaughan)
| Newsgroups | perl.golf |
|---|---|
| Organization | International Pedant Conspiracy |
| Message-ID | <200210211932.06791@gjm> |
On Monday 21 October 2002 8:14 am, Andrew Savige wrote:
> 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 (sic):
>
> sub subst {
> my $a;
> join '', map {++$a%2 ? $_ : eval} split /(\$\d+)/, shift;
> }
I'm feeling very dim. What's wrong with the much simpler
sub subst { (my $a=shift) =~ s/\$\d+/eval$&/eg; $a; }
?
--
g