Re: Using home-grown modules in mod-perl

[prev] [thread] [next] [Date index for 2005/01/31]

From: Leo
Subject: Re: Using home-grown modules in mod-perl
Date: 18:49 on 31 Jan 2005
Kent, Mr. John (Contractor) wrote:

>Leo,
>
>I am not using OO coded modules.  My  modules 
>contain methods.
>
>Other routines call this module's routines as you indicated:
>
>In order to solve other mod-perl problems I followed Stas's recommendation
>to call all my routines thusly:
>
>MyModule::foo(...)
>
>So, since I am doing it this way I should use in my startup:
>
>/use/lib qw (/users/webuser/homegrown/lib);
>use MyModule();   
>
>and not use EXPORT?
>
>Thank you,
>John Kent
>  
>

I didn't follow your thread with Stas.

How are you calling the methods contained in MyModule?

Exporter may be something you need to use in MyModule.pm  (within your 
homegrown directory)

I have written several such modules (function only libraries that 
perform simple straight forward tasks that don't require all the OO 
stuff) and they work fine in mod_perl.  This is not a mod_perl specific 
question.

Take a look at:

man perlmod for details about using modules in perl.  There are many 
tips about how to get your methods exported.

Is use a BEGIN block right after my use declarations

BEGIN {
    use Exporter;
    use vars qw(VERSION ISA EXPORT);
    $VERSION = '0.1';
    @ISA = qw(Exporter);
    @EXPORT = qw(<insert space delimited list of method names to export 
by default>);
}

...

Leo

Using home-grown modules in mod-perl
Kent, Mr. John \(Contractor\) 15:55 on 31 Jan 2005

Re: Using home-grown modules in mod-perl
Jonathan Vanasco 16:09 on 31 Jan 2005

RE: Using home-grown modules in mod-perl
Kent, Mr. John \(Contractor\) 17:15 on 31 Jan 2005

RE: Using home-grown modules in mod-perl
Steven Lembark 17:20 on 31 Jan 2005

Re: Using home-grown modules in mod-perl
Leo 18:49 on 31 Jan 2005

Generated at 12:39 on 05 Feb 2005 by mariachi v0.52