in reply to Undefined subroutine errors
Design issues asside, Exporter needs to be loaded (and its configuration variables must be initialized) before the other module of the pair is loaded. Using the following templates will allow both modules to import from each other:
use strict; use warnings; package SpiderMan; BEGIN { our @ISA = qw( Exporter ... ); our @EXPORT_OK = qw( ... ); require Exporter; } use ...; use ...; use Doctor::Octopus; use ...; use ...; ... 1;
use strict; use warnings; package Doctor::Octopus; BEGIN { our @ISA = qw( Exporter ... ); our @EXPORT_OK = qw( ... ); require Exporter; } use ...; use ...; use SpiderMan; use ...; use ...; ... 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Undefined subroutine errors
by Anonymous Monk on Oct 26, 2005 at 19:50 UTC | |
by ikegami (Patriarch) on Oct 27, 2005 at 15:08 UTC |