develooper Front page | perl.perl5.porters | Postings from May 2012

Re: [perl #46581] perlop Document clarification

Thread Previous | Thread Next
From:
demerphq
Date:
May 25, 2012 03:34
Subject:
Re: [perl #46581] perlop Document clarification
Message ID:
CANgJU+VHswdFrcogDYqYEcpp9Tynj93-bGpnL8D2gMuNLSn7Ew@mail.gmail.com
On 25 May 2012 07:58, Tom Christiansen <tchrist@perl.com> wrote:
> "Brian Fraser via RT" <perlbug-followup@perl.org>
>    wrote on Thu, 24 May 2012 20:13:28 PDT:
>
>> perlop as of 5.16.0 still has the original line. I personally think the
>> clarification is useful (some weeks back I was surprised by 'my $x; $x
>> += 1;' not producing warnings), but I don't have a commit bit.
>> Linda, would you mind submitting a patch for this? It'll help the odds
>> of this being applied, I think.
>
> The thinking behind all this is that normal initialization of
> an undeffed variable shouldn't generate warnings.  The four
> operators that are considered "normal" ways of initializing
> undeffed variables are =, .=, +=, and ++.

I seem to recall the exception applies to more cases than that.

Yves


-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About