navneet03 has asked for the wisdom of the Perl Monks concerning the following question:
I have a perl module : abcUtil.pm which has a subroutine check :
When I execute this , it works fine, But when i use this pm in another perl:package abc::abcUtil; require "common.pl"; sub check { .. PERL_DEBUG(""); # PERL_DEBUG is in common.pl .. }
Here, if I call func(), I get this error : "Undefined subroutine &abc::abcUtil::PERL_DEBUG .." There are other direct occurrences of PERL_DEBUG in this perl file which are working fine. What might be wrong ? Thanks -------------- I updated the code in the 2nd file as follows:require "common.pl"; use abc::abcUtil; sub func { abc::abcUtil::check(); }
Basically removed the use of common.pl. Kept the abcUtil file as unchanged. Now it worked. But I can't keep it this way as have to use this common file. Is it some conflict due to the use of 'require "common.pl" ' in both the files?#require "common.pl"; use abc::abcUtil; sub func { abc::abcUtil::check(); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Undefined subroutine &abc::abcUtil::PERL_DEBUG
by moritz (Cardinal) on Aug 20, 2012 at 11:58 UTC | |
by navneet03 (Initiate) on Aug 20, 2012 at 13:28 UTC | |
by Anonymous Monk on Aug 20, 2012 at 13:37 UTC | |
by navneet03 (Initiate) on Aug 21, 2012 at 04:29 UTC | |
by Anonymous Monk on Aug 21, 2012 at 07:27 UTC | |
Re: Undefined subroutine &abc::abcUtil::PERL_DEBUG
by Anonymous Monk on Aug 20, 2012 at 12:24 UTC |
Back to
Seekers of Perl Wisdom