in reply to Re^2: my $var masked across package scope?
in thread my $var masked across package scope?

"Are there any benefits to having package not be a lexical boundary?"

It's sometimes handy to switch package mid-sub...

use v5.12; use Data::Dumper (); # not importing Dumper function here sub d { package Data::Dumper; # please don't clobber @_ local *Indent = local *Terse = 1; say Dumper(@_); } d [1, 2, 3]; d {foo => 123};

Also if package touched lexical variables it would probably confuse newbies into thinking that namespaces and lexical scopes have something to do with each other.

package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
/div