Closed fgabolde closed 10 years ago
Yes, they are, however this is "intended" behavior. class
blocks are not the same as package
blocks, they are more like sub
blocks.
In fact, class
follows sub
both in this regard as well as in naming. So package Bar { class Foo {} }
created a class named Bar::Foo
while package Bar { class Foo::Bar {} }
creates a class named Foo::Bar
, just as a sub
would.
Ah, fair enough. My classes are no longer polluting the global namespace now!
The comparison to subs is really spot on, is this documented somewhere?
No, not yet. Documentation is part of New Years Resolution, along with spending more time on p5p.
On Dec 31, 2013, at 10:31 AM, Fabrice Gabolde notifications@github.com wrote:
Ah, fair enough. My classes are no longer polluting the global namespace now!
The comparison to subs is really spot on, is this documented somewhere?
— Reply to this email directly or view it on GitHub.
E.g.
Fails with:
Adding
namespace::clean
after the reftype import makes the problem worse (my perl 5.18.1 segfaults, actually).