On Dec 22, 2003, at 1:06 AM, Support wrote:


Hi All
I have a perl module I want to use in a perl script and
make available by the  ' use mymodule.pm'  call.

I'll presume you meant


use mymodule; # don't need the *.pm

Plus I would like to place it the same directory as the main script.
The main script runs fine until I make a call to the module. I then
then I get a ' subroutine not defined '
What am I doing wrong. Thanks for your help

Have you read the section


perldoc Exporter

package YourModule;
require Exporter;
@ISA = qw(Exporter);
@EXPORT_OK = qw(munge frobnicate); # symbols to export on request



since as dan is pointing at it, one either needs to list out the specific functions that one wishes to import:

        use mymodule qw/
                the_first_function
                the_second_function
                the_third_function
                /;

or one should call them out expressly

my $got_back = mymodule::the_first_function(@arglist);

but this of course assumes that they were Exported to begin with
in the perl module.


ciao drieux

---


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to