D
Daniel
I've got quite a large programme that's working just fine except for a
few minor bugs and several design flaws. So I've decided to clean it up
a bit. It uses several self-written objects and modules, so I thought a
good way to start would be to put them in a sub directory. But I get an
error: "Undefined subroutine &main::d1 called at a.pl...". I've reduced
everything down to this:
#### main programme (./a.pl)
#!perl
use strict;
use warnings;
use bb;
use cc::dd;
b1();
d1();
#### module bb (./bb.pm)
package bb;
use strict;
use warnings;
use Exporter;
our @ISA = qw(Exporter);
our @EXPORT = qw(b1);
sub b1 { print "b1\n" }
1;
#### module dd in local sub directory cc (./cc/dd.pm)
package dd;
use strict;
use warnings;
use Exporter;
our @ISA = qw(Exporter);
our @EXPORT = qw(d1);
sub d1 { print "d1\n" }
1;
"b1" get's printed. But if I move the same code to the sub directory
and just alter the use statement (in my example as dd and d1) I get the
above error message.
The module dd does get loaded: the original file had an END block that
does get executed after the error message.
This is Windows XP SP2 with ActiveState 5.8.8
What did I do wrong? I thought moving the packages to a different place
would only need a alteration of the use statement. But it seems that is
not so. Any ideas?
Regards
Daniel Cutter
few minor bugs and several design flaws. So I've decided to clean it up
a bit. It uses several self-written objects and modules, so I thought a
good way to start would be to put them in a sub directory. But I get an
error: "Undefined subroutine &main::d1 called at a.pl...". I've reduced
everything down to this:
#### main programme (./a.pl)
#!perl
use strict;
use warnings;
use bb;
use cc::dd;
b1();
d1();
#### module bb (./bb.pm)
package bb;
use strict;
use warnings;
use Exporter;
our @ISA = qw(Exporter);
our @EXPORT = qw(b1);
sub b1 { print "b1\n" }
1;
#### module dd in local sub directory cc (./cc/dd.pm)
package dd;
use strict;
use warnings;
use Exporter;
our @ISA = qw(Exporter);
our @EXPORT = qw(d1);
sub d1 { print "d1\n" }
1;
"b1" get's printed. But if I move the same code to the sub directory
and just alter the use statement (in my example as dd and d1) I get the
above error message.
The module dd does get loaded: the original file had an END block that
does get executed after the error message.
This is Windows XP SP2 with ActiveState 5.8.8
What did I do wrong? I thought moving the packages to a different place
would only need a alteration of the use statement. But it seems that is
not so. Any ideas?
Regards
Daniel Cutter