Seems to work OK for me. I've never had any problems with this. Could you post some code, particularly how @EXPORT and friends are populated.
Just knocked up the following to prove that export behaves as expected: (note that I have not called the packages A and B because of a potential namespace clash with B::)
package Alpha; use strict; BEGIN { use Exporter (); use vars qw ($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); $VERSION = 0.01; @ISA = qw (Exporter); @EXPORT = qw (foo); @EXPORT_OK = qw (foo); %EXPORT_TAGS = ( all => [qw/foo/]); } sub foo { print "Working\n"; } 1;
Executing the command perl -MBravo -e "bar()" outputs the string "working".package Bravo; use strict; use Alpha; BEGIN { use Exporter (); use vars qw ($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); $VERSION = 0.01; @ISA = qw (Exporter); @EXPORT = qw (bar); @EXPORT_OK = qw (bar); %EXPORT_TAGS = ( all => [qw/bar/]); } sub bar { foo(); } 1;
--
Oh Lord, won’t you burn me a Knoppix CD ?
My friends all rate Windows, I must disagree.
Your powers of persuasion will set them all free,
So oh Lord, won’t you burn me a Knoppix CD ?
(Missquoting Janis Joplin)
In reply to Re: error for undefined function that's been imported
by rinceWind
in thread error for undefined function that's been imported
by argv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |