RE: use lib - not known at compile time
From: John Moon (john.moon_at_myflorida.com)
Date: 07/29/04
- Next message: Bob Showalter: "RE: use lib - not known at compile time"
- Previous message: James Edward Gray II: "Re: Endless Loop"
- Next in thread: Bob Showalter: "RE: use lib - not known at compile time"
- Maybe reply: Bob Showalter: "RE: use lib - not known at compile time"
- Maybe reply: Luke Bakken: "RE: use lib - not known at compile time"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: "'Thompson, Glenn'" <gtho@bgs.ac.uk>, beginners@perl.org Date: Thu, 29 Jul 2004 11:02:50 -0400
You may wish to look at "BEGIN" ...
Hope that gives you some ideas...
Thanks,
jwm
-----Original Message-----
From: Thompson, Glenn [mailto:gtho@bgs.ac.uk]
Sent: Thursday, July 29, 2004 10:54 AM
To: beginners@perl.org
Subject: use lib - not known at compile time
I'm trying to add my own module "DEGS::ldegs" to a Perl program.
However, this module will part of a distribution called "RGSE",
which could be installed on a different path on different peoples PCs.
However, it will always be in the directory "$ENV{RGSE}/lib".
The problem is when I run the program I get an error like:
"Empty compile time value given to use lib at /home/gtho/Rgse/bin/depsol-gmt
line 44"
This presumably is because "use lib" cannot be used on a variable that is
undefined at compile time.
Now I know I can run the program in the following way:
perl -I$ENV{RGSE}/lib myprogram.pl
which could easily be put in a wrapper shell script.
But is there anyway of avoiding this, and have "use lib" work on $ENV{RGSE}
"dynamically"?
Hopefully I'm missing something really simple here!
Here is a snippet from the program:
use lib "$ENV{RGSE}/lib"; # directory when DEGS::ldegs is contained
# Read necessary Perl libraries
use DEGS::ldegs qw(&wait_for_enter &run &pythag &minmax &get_obj
&get_y_limits
&page_get_size &set_tick_interval &add_legend
&get_lim2
&page_setup_gm &add_fold_points);
Thanks,
Cheetah
*********************************************************************
This e-mail message, and any files transmitted with it, are
confidential and intended solely for the use of the addressee. If
this message was not addressed to you, you have received it in error
and any copying, distribution or other use of any part of it is
strictly prohibited. Any views or opinions presented are solely those
of the sender and do not necessarily represent those of the British
Geological Survey. The security of e-mail communication cannot be
guaranteed and the BGS accepts no liability for claims arising as a
result of the use of this medium to transmit messages from or to the
BGS. . http://www.bgs.ac.uk
*********************************************************************
-- To unsubscribe, e-mail: beginners-unsubscribe@perl.org For additional commands, e-mail: beginners-help@perl.org <http://learn.perl.org/> <http://learn.perl.org/first-response>
- Next message: Bob Showalter: "RE: use lib - not known at compile time"
- Previous message: James Edward Gray II: "Re: Endless Loop"
- Next in thread: Bob Showalter: "RE: use lib - not known at compile time"
- Maybe reply: Bob Showalter: "RE: use lib - not known at compile time"
- Maybe reply: Luke Bakken: "RE: use lib - not known at compile time"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|