You cannot use push(@INC, '.') in the normal way because it is a runtime
function call and @INC must be changed at translation time. Instead use
use lib '.';
at the top of your program.
Tanton
----- Original Message -----
From: "chad kellerman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 15, 2002 1:48 PM
Subject: perl modules?
Hello,
Boy this stuff can get frustrating....
I am trying to include my own perl module that is outside the regular @INC
array. But my perl script still can not find it.. Any suggestions would be
appreciated...
Here is what I have...
script.pm
package Script;
BEGIN {
use Exporter;
@ISA = qw( Exporter );
@EXPORT = qw($serverList);
}
# declaring variable for main server list
my $serverList = "/home/user/somefile";
return 1;
END { }
script.pl
use strict;
$|++;
push (@INC, '.');
use FileHandle;
use Script;
use vars qw(
$msl %msl
);
print $serverList;
But is fails with the typical Can't locate Script.pm in @INC (@INC
contains:
etc.
I am on linux running this from /home/server/scripts/
Can anyone see what I an doing wrong from this?
Thanks for the help.
chad
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]