On 09/08/06, Beginner <[EMAIL PROTECTED]> wrote:
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.
probably, but I want to distribute the app I'm (re)doing and last time
I tried enabling mod_perl (on FC4) there were major issues.
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.
Thats all done.
The issue I have is this
The modules/scripts are setout as
big hash contains submit param value => script to run
subs run sequentially (3-4 steps)
From the script stub the first two stages run, but then the param gets
"lost" and reloads the initial script.
I have a couple of solutions that work I'm not happy with them, so
seems a good opportunity to get to grips with modules.
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>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>