On 9 Aug 2006 at 14:28, Mike Martin wrote:

> Does anyone know of any resources to aid in this?
> 
> I have a few scripts which I am trying to turn into modules, however
> the functions which run as a script (CGI) do not run as modules
> 
> Any help etc

This sounds like a job for modperl.

Persumably you want to just take a lot of existing functions, stick 
them in one script and have them available for other script to use.

Create a file such as "myfile.pm". In that file you need at least the 
following:

======================
package myfile;         # same name as myfile but without the .pm

require  Exporter;
use strict;
use warnings;

our @ISA        = qw(Exporter);
our @EXPORT     = qw( functions_to_export here);
...
..
1;                                      # has to end with a 1
=============================

The file needs to be in @INC or the current directory of the calling 
script.


Other sources of info:

Chapter 2 of the Alpaca book 
Chapter 12 of the Bighorn Sheep book.
http://perl.apache.org/docs/index.html


Good luck.
Dp.


-- 
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