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 n
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!
This results in:
Can't locate object method "Dumper" via package "This::Name"My code, on the other hand, works as expected:
I don't mean this a slam against namespace. The author wrote some really nifty code. Unfortunately there are unwanted side-effects from making it more complicated than it needs to be.
Reply to This
Parent