in reply to Re: Wrapping requires in a package...
in thread Wrapping requires in a package...
To expand on the update a bit, Perl has what feels like a bug to me in that if you do:
any subroutines defined in 'that.pl' will be placed into the a 'this' package, but __PACKAGE__ gets expanded to "main" in such code. So, in some aspects, the code is compiled in the requested package and in other aspects the code is compiled in the package "main". This probably shouldn't be possible.package this; require 'that.pl';
However, requiring files that don't declare what package they are in is a bad practice so I find little motivation to report this problem compared to more serious problems that I should be working on...
- tye (but my friends call me "Tye")
|
|---|