in reply to deprecation problem

Also,
I have a function in "mytool" called print_usage. In the Perl module "common.pm" the process_error function calls print_usage. When I try to do this I am getting the error:
Undefined subroutine &common::print_usage called at common.pm line 100
So common.pm does not know about print_usage from "mytool".
All help is appreciated!
-sk

Replies are listed 'Best First'.
Re: Re: deprecation problem
by japhy (Canon) on Feb 11, 2002 at 22:38 UTC
    Does common.pm require() or use mytool.pm anywhere? And if so, does it import that function from it?

    _____________________________________________________
    Jeff[japhy]Pinyan: Perl, regex, and perl hacker, who could use a job
    s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

Re: Re: deprecation problem
by rjray (Chaplain) on Feb 11, 2002 at 23:37 UTC

    When you are within the package called "common", all function calls are assumed to be calls to functions in that same package, unless you fully-qualify the fuction name itself. Assuming that "mytool" is a script, you were trying to call a routine that is in the main:: namespace from within the common:: namespace.

    --rjray

      After preceding the call to the print_usage function by "main::", that solved my problem. Thanks alot. I still have much to learn!