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.
Huh? (Score:1)
What does it mean to change package within a sub?
Re:Huh? (Score:2)
Well, package declarations are lexically scoped. It would have been simpler for me to have simply declared another package in that file and have the subroutine return a new object created from that package. Instead, just because of the way the refactoring worked, I had simply wrapped the package in the sub and now that I look at it, I can't see why this would be a bad thing.
There's no real benefit that I can tell, but there's no real harm I can identify, either.
Reply to This
Parent