Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Undefined subroutine &abc::abcUtil::PERL_DEBUG

by moritz (Cardinal)
on Aug 20, 2012 at 11:58 UTC ( #988439=note: print w/replies, xml ) Need Help??

in reply to Undefined subroutine &abc::abcUtil::PERL_DEBUG

You need to use Exporter and set it up so that &check is exported, and thus can e used in the script or modules that uses it.

Update: MidLifeXis++ pointed out that it's a fully qualified call that goes wrong, so Exporter is likely not the solution.

From the code you have shown I can't figure out what's wrong. But since the code you did show has so many errors (missing semicolon all over), I'd guess that the most likely cause is a mis-spelled package name. If that's not the case, please reduce your problem to a few lines in each file, and post the complete (reduced) code that shows your code.

Replies are listed 'Best First'.
Re^2: Undefined subroutine &abc::abcUtil::PERL_DEBUG
by navneet03 (Initiate) on Aug 20, 2012 at 13:28 UTC
    I updated the code in the 2nd file as follows:
    #require ""; use abc::abcUtil; sub func { abc::abcUtil::check(); }
    Basically removed the use of 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 "" ' in both the files?

      So what does do? has some common subroutines that can be used by others. PERL_DEBUG is one of them. I have to use in both the files. It was only for a test that i tried removing it from one file to see if it works and it did.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://988439]
[Discipulus]: good morning vietnam!

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (10)
As of 2017-02-22 07:34 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (325 votes). Check out past polls.