EDIT: Also am I right in thinking that the reason this works is because I am calling that specific module with keys %My::Package::. If i am wrong please help me understand... more better :)As a partial answer to this question, I've changed your module as follows:
And then I can run the test program without specifying the list of symbols to be imported:# ... use Exporter qw(import); @EXPORT = (keys %My::Package::); # @EXPORT instead of @EXPORT_OK # ...
So it seems that the work is really done within the module, which is exporting its symbols.$ perl -e ' use strict; use warnings; use My::Package; test("hello world\n"); test_2("hello this is dog"); ' hello world hello this is dog
In reply to Re: Is this safe to export and import functions this way?
by Laurent_R
in thread Is this safe to export and import functions this way?
by james28909
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |