By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,279 Members | 1,673 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,279 IT Pros & Developers. It's quick & easy.

pm problem

P: 2
Hello,
i am working with Apache / mod_perl on a WinXP system and
i have following problem, i have written a perl script which is running like i want.
as i want to use parts of it in other scripts i picked the relevant subroutines into a new file in the same directory naming it list_engine.pm and starting with

Expand|Select|Wrap|Line Numbers
  1. package list_engine;
  2. use strict;
  3. use warnings;
  4. use Exporter;
  5. use vars qw(@ISA @EXPORT $VERSION);
  6. @ISA = qw(Exporter);
  7. @EXPORT = qw(list_engine);
  8. $VERSION = '0.01';
as you may thought, it has only one sub i needing listengine.

But when i insert following line in the main perl program
use list_engine "C:/apa/mod_perl/mask/";


apache throws error 500
with list_engine not found in @INC
BEGIN failed--compilation aborted at C:/apa/mod_perl/mask/list_L.pl

when i delete the use line from the main program, the scripts runs ok like it would use the previous compiled version (with the sub routine inside the main program).

Inserting the lib file in one of the INC folders solves the problem (but i would like to use the lib in my parent folder).

2.Second question is, how can i force apache./ mod_perl to recompile the scripts, after changing something in the .pm file ?
Jan 21 '08 #1
Share this Question
Share on Google+
3 Replies


eWish
Expert 100+
P: 971
Welcome to TSDN!

The answer to your first question is that the module it not located in the same place where perl looks. If you use the lib pragmas then it you can put the module where you like. I have not use mod_perl so I can't answer the second question.

--Kevin
Jan 21 '08 #2

KevinADC
Expert 2.5K+
P: 4,059
This looks wrong anyway:

use list_engine "C:/apa/mod_perl/mask/";

the list of arguments afer the module name should be the stuff you want to import from the module, not a directory path.
Jan 22 '08 #3

P: 2
Hi,
thanks for the answers, i will try out.
oh, i did misunderstand lib as a place holder for lib/module name, my fault.
as i am only programing for my personal demands, can somebody forward me nice tutorial how to manage clever your private perl script libraries?
Jan 22 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.