Rob Dixon schreef:
> Dr.Ruud:
>> John W . Krahn:

>>>        /Powerball:/ and my @numbers = /\d+/g;
>>
>> I wouldn't use such a conditional "my".
>
> There is no conditional 'my': it is a de[c]laration.

I call it a conditional "my". A "my" can be just a declaration, or a
declaration and an initialisation. In this case only the initialisation
is conditional.

A "my" in a condition has special behaviour if the condition is constant
false: "0 and my $var;" creates a static $var.

As I wrote: *I* wouldn't use *such* a conditional "my". I put the
declaration on its own line, just before the conditional initialisation.

I sometimes use a conditional my if I want the static behaviour, but not
in production code. Perl 5.10 has "static".

-- 
Affijn, Ruud

"Gewoon is een tijger."


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to