So, to sum up... I think we all agree these should all warn.

    my $x;  our $x;  # this currently does not
    our $x; my $x;
    my $x;  my $x;
    our $x; our $x;

and that this should not

    package Foo;
    our $x;

    package Bar;
    our $x;

but this appears to be up in the air:

    package Foo;
    my $x;

    package Bar;
    our $x;

Currently this warns.  Rick's patch to fix "my $x; our $x;" changes this
so that it does not warn on the grounds that the "package Foo; our $x;
package Bar; our $x" case doens't warn either.  But I say that's a
special case to do with the fact that our's mix of two scoping
mechanisms, lexical and package, runs afoul of multi-package-in-one-file
programming idioms.

    package Foo;
    our @ISA = qw(...);  # or $VERSION or @EXPORT or ...

    package Bar;
    our @ISA = qw(...);

There's no corresponding idiom for "package Foo; my $x; package Bar; our
$x" or vice-versa.  Therefore, it should warn about the mask.

Reply via email to