[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Add to elements of a list



At 05:18 PM 4/8/00 -0400, Rick Delaney wrote:
>Peter Scott wrote:
> >
> > At 02:02 PM 4/8/00 -0600, Nathan Torkington wrote:
> > >
> > >   &{sub { while(@_) { ${+shift} += pop } }}(\$z, \$y, \$x, foo())
> >
> > There, that's the spirit :-)  Golf, anyone?
>
>Here's one more way that violates the temp variable restriction:
>
>     ${\($x, $y, $z)[$i++]} += $_ for foo;

Clearly these years of using strict and -w have corrupted my brain.  If $x 
etc are package variables:

      ${$a ||= 'x', $a++} += $_ for foo();

*ducks*

--
Peter Scott
Pacific Systems Design Technologies


==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe