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
Yes
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
I will do
perldoc Exporter
package YourModule;
require Exporter;
@ISA = qw(Exporter);
@EXPORT_OK = qw(munge frobnicate); # symbols to export on request
This is part of the module
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw();
@EXPORT_OK =
qw(
Days_in_Year
Days_in_Month
Weeks_in_Year...............etc
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>
--
Incoming mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.209 / Virus Database: 261.5.2 - Release Date: 20/12/2003
Outgoing mail is certified Virus Free. Checked by AVG Anti-Virus (http://www.grisoft.com). Version: 7.0.209 / Virus Database: 261.5.2 - Release Date: 20/12/2003
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>