in reply to Perl complains of redefining undefined module export
The bulk of your problems, I believe, lie in the apparent lack of any sub declaration in scope (at the time that Exporter does its work) - if there are subs declared in the module, they won't have been parsed until after the BEGIN block has run i.e. your use of Exporter in the BEGIN block is far too early in the compilation cyclepackage SomePkg; use warnings; use strict; use Exporter; our @ISA = qw/Exporter/; our @EXPORT = qw/&GeneratorConfig &Generate &GetWidthFromType &GetWidt +hFromFormat/; sub GeneratorConfig { ... } sub Generate() { ... } sub GetWidthFromType { ... } sub GetWidthFromFormat { ... } 1;
Note that the using strictures might have pointed you in right direction a little earlier.
Note also that it is extremely unadvisable to export everything by default (via @EXPORT), it is far more preferable to export on demand (using @EXPORT_OK).
As an aside, I've recently been asked about a similar situation in some extremely legacy code - the workaround (given that there are over 100 warnings if strictures are enabled) was to change use to require.
Update:
In the light of ikegamis salient qualification, I thought I ought to further qualify my comment ...it's not normal..., here, by normal, I was alluding to the module template generated by h2xs.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl complains of redefining undefined module export
by ikegami (Patriarch) on May 10, 2009 at 00:38 UTC | |
|
Re^2: Perl complains of redefining undefined module export
by ig (Vicar) on May 10, 2009 at 01:54 UTC | |
|
Re^2: Perl complains of redefining undefined module export
by ysth (Canon) on May 10, 2009 at 20:37 UTC | |
|
Re^2: Perl complains of redefining undefined module export
by WienIsset (Novice) on May 11, 2009 at 05:47 UTC |