
rovf
Veteran
Oct 12, 2011, 7:06 AM
Post #4 of 8
(3077 views)
|
Re: [schnick] make perl script monolithic
[In reply to]
|
Can't Post
|
|
Even if you don't do this in *your* code, you are very likely include modules which you haven't written by yourself (for example, Perl standard modules, and you likely can't say for sure that they don't do such tricks. Moreover, how would you resolve this?
# Module X.pm package X; use Exporter; our @EXPORT = qw(foo); our @EXPORT_OK = "baz"; sub foo {}; sub bar {}; sub baz {};
# Module Y.pm package Y; use Exporter; use X qw(); # import nothing our @EXPORT_OK = qw/foo bar baz/; sub foo {}; sub bar { X::baz() } sub baz {}
# Your file App.pl use X; use Y 'bar'; foo(); You would have to determine that you need only X::foo, X::baz and Y::bar, but none of the other functions.
|