AlfaProject has asked for the wisdom of the Perl Monks concerning the following question:
Gl/Uf.pm:package Gl::Df; use strict; use warnings; require Exporter; our @ISA = qw(Exporter); our @EXPORT = qw( tst1 ); our $VERSION = 1.00; use Gl::Uf; sub tst1 { tst2(); print 1 ;} 1;
Writing a script that wants to use both modules and their functions test.plpackage Gl::Uf; use strict; use warnings; require Exporter; our @ISA = qw(Exporter); our @EXPORT = qw( tst2 ); our $VERSION = 1.00; use Gl::Df; sub tst2 { tst1();print 2 } 1;
Error received :use strict; use warnings; use Gl::Df; use Gl::Uf; tst1(); tst2();
What may be the problem ? tst1 should be exporter to 3 scopes, and it is when I checking in the %Gl::Df:: and %Gl::Uf:: but Perl can't use themUndefined subroutine &Gl::Uf::tst1 called at Gl/Uf.pm line 14.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Package problem with defining subroutines (circular dependence)
by Anonymous Monk on Feb 05, 2013 at 15:39 UTC | |
|
Re: Package problem with defining subroutines
by Anonymous Monk on Feb 05, 2013 at 15:48 UTC | |
by AlfaProject (Beadle) on Feb 05, 2013 at 15:55 UTC | |
by Anonymous Monk on Feb 05, 2013 at 16:01 UTC | |
|
Re: Package problem with defining subroutines
by AlfaProject (Beadle) on Feb 05, 2013 at 16:30 UTC | |
by Anonymous Monk on Feb 05, 2013 at 18:02 UTC |