Using modules on server

D

D Borland

Hi folks,

Can anyone help out with the followings:-

I'm trying to use File::basename in a script rather than re-invent the wheel
as such as i keep getting told. But the hosting company i'm with don't have
it on and aren't likely to install it for me. Can i just upload the perl
module to the server myself and tell the use pragma where the module it
located? e.g. use mymodules/basename.pm;

With Thanks

Dagmar
 
G

Gunnar Hjalmarsson

D said:
I'm trying to use File::basename in a script rather than re-invent
the wheel as such as i keep getting told. But the hosting company
i'm with don't have it on and aren't likely to install it for me.
Can i just upload the perl module to the server myself and tell the
use pragma where the module it located? e.g. use
mymodules/basename.pm;

This is a short description (for another module) that should give you
the idea:
http://search.cpan.org/~gunnar/CGI-ContactForm-1.16/lib/CGI/ContactForm.pm#Manual_Installation
 
B

Bob Walton

D Borland wrote:

....

I'm trying to use File::basename in a script rather than re-invent the wheel

--------------------------^

File::Basename -- case matters in module names, even if you're on Windoze.


....
 
D

D Borland

File::Basename -- case matters in module names, even if you're on Windoze.
Yup, your right. Problem was it wasn't a typo, i thought that's the way i'd
use it before.

thanks

Dagmar
 
K

ko

D said:
Hi folks,

Can anyone help out with the followings:-

I'm trying to use File::basename in a script rather than re-invent the wheel
as such as i keep getting told. But the hosting company i'm with don't have
it on and aren't likely to install it for me. Can i just upload the perl
module to the server myself and tell the use pragma where the module it
located? e.g. use mymodules/basename.pm;

With Thanks

Dagmar

Yes. And if you set your PERL5LIB environmental variable to point to
your personal library directory, you don't even need the lib pragma,
*unless* the script is running: (1) with the -T switch, *or* (2)
setuid/setgid.

Also, some modules require you to specify the installation path to your
personal library directory if you don't have permissions to install in
the system directories (no root access). 'perldoc perlmodinstall'
suggests the following:

perl Makefile.PL PREFIX=/my/perl_directory

You should also consult the 'README' and other documentation that comes
with the distribution.

HTH -keith
 
D

D Borland

I found that the lib pragma did the trick, but then when i was pointed out
about the 'Basename' not 'basename' error, i didn't need the lib pragma
anymore :)

Thanks for everyones help.

Dagmar
 
B

Bart Lateur

D said:
I'm trying to use File::basename in a script rather than re-invent the wheel
as such as i keep getting told. But the hosting company i'm with don't have
it on and aren't likely to install it for me.

AFAIK File::Basename is, and has been for a long time, a core module,
meaning it comes with Perl. It looks like your ISP has been deleting
stuff.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,266
Messages
2,571,076
Members
48,772
Latest member
Backspace Studios

Latest Threads

Top