Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: Closure warning with Perl 5.14?

by moritz (Cardinal)
on May 19, 2011 at 10:24 UTC ( [id://905659]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Closure warning with Perl 5.14?
in thread Closure warning with Perl 5.14?

But shouldn't there be a warning in 5.12?

There should have been a warning for that in perl 5.0.

Shouldn't the warning be consistent in 5.14?

Variables declared in a conditional always was "undefined" behavior. To quote perlsyn:

NOTE: The behaviour of a "my" statement modified with a statement modifier conditional or loop construct (e.g. "my $x if ...") is undefined. The value of the "my" variable may be "undef", any previously assigned value, or possibly anything else. Don't rely on it. Future versions of perl might do something different from the version of perl you try it out on. Here be dragons.

(emphasis mine). The perl-5.14.0 behavior (new warning) is consistent with the documentation, and a good thing.

Replies are listed 'Best First'.
Re^4: Closure warning with Perl 5.14?
by BerntB (Deacon) on May 19, 2011 at 11:11 UTC
    Ahh... there was the documentation, I should have looked a bit more. :-( Thanks.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://905659]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2025-03-27 17:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When you first encountered Perl, which feature amazed you the most?










    Results (70 votes). Check out past polls.

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.