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

Re: [FWP] Testing list?



In article <4.2.2.20000102111820.00a2b3d0@mail.psdt.com>,
Peter Scott <Peter@PSDT.com> wrote:
>And so the above can be written as
>
>         @a = @a ? @a : (1, 2);
>
>which doesn't have any problem evaluating @a in multiple contexts.

How about:
{ my $var = 'aaa'; sub newvarname() {$var++} }
@{+newvarname} = 'hi';
@{+newvarname} = 'there';
print "@aaa @aab";

Should you be able to just replace the = with an ||= and have it work?

>It's merely a question of what would break if || propagated context as well.

|| does propagate context...to the right hand side.

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