I'm not sure how documented the behaviour you describe is, but the trailing double colons have another use. Consider the following:
use 5.010; { package Foo; sub new { bless [] } sub Bar { 'Quux' } } { package Foo::Bar; sub new { bless [] } } { package Quux; sub new { bless [] } } my $object1 = Foo::Bar::->new; say ref $object1; # says "Foo::Bar" my $object2 = Foo::Bar->new; say ref $object2; # says "Quux"
In reply to Re: Bareword Package Names
by tobyink
in thread Bareword Package Names
by martin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |