develooper Front page | perl.perl5.porters | Postings from November 2014

[perl #123322] "our" has the same scoping rules as "my" or "state"

Thread Previous | Thread Next
Father Chrysostomos via RT
November 30, 2014 00:14
[perl #123322] "our" has the same scoping rules as "my" or "state"
Message ID:
On Sat Nov 29 14:52:07 2014, wrote:
> So sometimes "our" is scoped like "my", and sometimes it isn't? ow!
> $ perl -E'use strict; $::x = "pkg";                say our $x, $x'
> pkgpkg
> $ perl -E'use strict; $::x = "pkg"; my $x = "lex"; say our $x, $x'
> pkglex
> I just said the docs weren't accurate, but now you tell me the behaviour is
> wacky too.


The stricture exemption applies to the current statement, but the lexical visibility is delayed till the following statement.

> The linked thread explains that introducing the wackiness was
> necessary because it was a maintenance release. But that's done. I just
> mentioned the docs were inaccurate, but some consistency (one way or
> another) would be nice.

A doc patch would be nice. :-)  (I would say ‘patches welcome’, but I have never seen a patch welcome anyone.)


Father Chrysostomos

via perlbug:  queue: perl5 status: open

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About