Link to home
Start Free TrialLog in
Avatar of stakor
stakorFlag for United States of America

asked on

Perl Module Question

I am trying to use a module in my perl script. I do not have access to the directories that are in perl's search path however. How do I include a perl module in my script when I don't have permission to put it in the path that perl searches?

I would like to use:
use BlahThing;

where BlahThing.pm has all of my variables. My BlahThing.pm module is in the same directory as my script.
ASKER CERTIFIED SOLUTION
Avatar of FishMonger
FishMonger
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of stakor

ASKER

When I attempt to do this, I get the following:

Global symbol "$work_tar_dir" requires explicit package name at BlahThing.pm line 15.
Compilation failed in require at /home/username/script.pl line 14.
BEGIN failed--compilation aborted at /home/username/script.pl line 14.

The first part of the script is below (Minus comments):

#!/usr/bin/perl

#
#
#
#
#

use strict;
use warnings;

#
use lib '.';
use BlahThing;
use File::Basename;

#
chdir($drop_dir) or die "Cant chdir to $drop_dir $!";
Is $drop_dir defined in BlahThing?  If so, did you export it?

Is BlahThing defined as a module or is it simply a library file?