NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Why not use namespace? (Score:2)
-sam
Re:Why not use namespace? (Score:2)
First, if you just want the last part of the class name, aliased has the simpler syntax:
Second, compare the implementations. I am just exporting a single subroutine. namespace jumps through a lot of weird hoops, diddles the aliased @ISA array, and has rather coplicated code. Further, it will die if the target namespace is already defined, but if that namespace gets defined later, your code is much more likely to break.
Third, I have tests :)
Maybe I should document this?
Reply to This
Parent
Re:Why not use namespace? (Score:2)
-sam
Re:Why not use namespace? (Score:2)
I was mistaken. namespace also does not allow function calls. In trying this with my test suite, I have this:
It says that This::Name::new is an undefined subroutine. But, it turns out the problem is worse than that!