[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Omaha.pm] Using a perl module without installing it...



Dan,

I use a custom set of routines that I place in my personal ~/bin/PM 
directory.  Here is the header of one perl program that includes two
of my "libraries".

--------------------------
#!/usr/bin/perl

use Getopt::Std;
use IO::Tee;
use Net::Ping::External qw(ping);

use lib "$ENV{HOME}/bin/PM";
use Utils qw(SetTimeVars ip2val $mday $mon $yr I_Am_Interactive);
use SendMail;
--------------------------

The libraries "Utils" and "SendMail" are files called Utils.pm and 
SendMail.pm under the ~/bin/PM directory.

HTH,
-Scott

-----Original Message-----
From: omaha-pm-bounces@pm.org [mailto:omaha-pm-bounces@pm.org]On Behalf
Of Daniel Linder
Sent: Tuesday, January 11, 2005 2:59 PM
To: omaha-pm@mail.pm.org
Subject: [Omaha.pm] Using a perl module without installing it...


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm doing some development on a customers system.  I am using Perl scripts
to do some quick-and-dirty data manipulation.  I need to use a module but
I can't install it on this system.

The packge itself (Statistics-LineFit) is very simple -- the whole
inteligence of the package is contained in a single file
(lib/Statistics/LineFit.pm).  To use this package normally, you would "use
Statistics::LineFit;", but that will look in the system library
directories.

Questions:
1: Can anyone give me pointers so that I can replace the "use XXX::YYY;"
syntax and do something like "include /full/path/to/YYY.pm" or other such
trick?

2: Or, can someone give me hints as to how to write my script to modify
the @INC variable (??) to use ~/lib rather than the systems default
"/usr/lib/perl5/..." directories?

Dan


- - - - -
"I do not fear computer,
I fear the lack of them."
 -- Isaac Asimov
GPG fingerprint:9EE8 ABAE 10D3 0B55 C536  E17A 3620 4DCA A533 19BF

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFB5D38NiBNyqUzGb8RAphpAKCJvgjjh8QVSwzDxZRvtsxPt2tISgCcD4OX
a0ZBLiniAHzoza26Pjc9Wbc=
=rxtD
-----END PGP SIGNATURE-----
_______________________________________________
Omaha-pm mailing list
Omaha-pm@pm.org
http://mail.pm.org/mailman/listinfo/omaha-pm