Re: Can perl modules RECIPROCALLY 'use' one another?
- From: Peter Scott <Peter@xxxxxxxx>
- Date: Wed, 29 Jun 2005 15:39:08 GMT
On Wed, 29 Jun 2005 14:17:50 +0000, Ignoramus4093 wrote:
> Can I have a perl module
>
> package A;
> use B;
>
>
> and another module
>
> package B;
> use A;
>
>
> would they be able to call one another's subroutines?
If both export subroutines, the second module won't get the first one's
names exported because %INC has already been set when the first one was
loaded. This is a known problem. It's not hard to write an example.
> And if that's not the case, how would I implement a similar pattern?
The general consensus is to not do cyclic dependencies between
exporting modules. If you must, call the other module's routines
with package-qualified names.
--
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/
.
- Follow-Ups:
- Re: Can perl modules RECIPROCALLY 'use' one another?
- From: Brian McCauley
- Re: Can perl modules RECIPROCALLY 'use' one another?
- Prev by Date: Re: RFC: Net::IP::Correct
- Next by Date: Re: RFC: Net::IP::Correct
- Previous by thread: Re: Can perl modules RECIPROCALLY 'use' one another?
- Next by thread: Re: Can perl modules RECIPROCALLY 'use' one another?
- Index(es):
Relevant Pages
|