Re: Use lib

2008-10-07 Thread Rob Dixon
Dermot wrote: > > I have seen the following is a book > > > use strict; > use warnings; > use FindBin qw($Bin); > use Path::Class; > use lib dir ($Bin,'..','lib')->stringify; > > > An adopted it into a script of my own. I understand that this FindBin > will allow the code to be ported between

Re: Use lib

2008-10-07 Thread Mr. Shawn H. Corey
On Tue, 2008-10-07 at 12:36 +0100, Dermot wrote: > Hi, > > I have seen the following is a book > > > use strict; > use warnings; > use FindBin qw($Bin); > use Path::Class; > use lib dir ($Bin,'..','lib')->stringify; > > > An adopted it into a script of my own. I understand that this FindBin >

Re: use lib

2007-04-02 Thread Igor Sutton Lopes
Hi,, On 2007/04/02, at 20:32, Nigel Peck wrote: Hi, I've recently starting writing my own modules. At the top of each script that uses my modules I do: use lib qw( /home/nigel/mis_perl_modules/dev ); while I'm developing them and then change it to: use lib qw( /home/nigel/mis_perl_modul

Re: use lib

2007-04-02 Thread Bill Jones
On 4/2/07, Nigel Peck <[EMAIL PROTECTED]> wrote: My question is, is this the best way to go about having modules in development? Yes and no. Read more about this at: http://www.perlmonks.org/index.pl?node_id=238691 -- WC (Bill) Jones -- http://youve-reached-the.endoftheinternet.org/ http://

Re: 'Use Lib' problem...

2005-08-01 Thread Tony Frasketi
Sorry... Didn't notice that's what it was Tony Dave Gray wrote: On 7/26/05, Tony Frasketi <[EMAIL PROTECTED]> wrote: I'm trying to use the following 'use lib' statement as described at http://www.unix.org.ua/orelly/perl/prog3/ch31_13.htm It's not nice to link to pirated c

Re: 'Use Lib' problem...

2005-08-01 Thread Dave Gray
On 7/26/05, Tony Frasketi <[EMAIL PROTECTED]> wrote: > I'm trying to use the following 'use lib' statement as described at > http://www.unix.org.ua/orelly/perl/prog3/ch31_13.htm It's not nice to link to pirated copies of books. BAD. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additi

Re: 'Use Lib' problem...

2005-08-01 Thread Jeff 'japhy' Pinyan
On Jul 30, Tony Frasketi said: CGIDIR=$HOME/cgi-bin PMDIR=$CGIDIR/pm export CGIDIR PMDIR Then in my CGI script I have... - use lib "$PMDIR"; No, you need to use $ENV{PMDIR} here. Environment variables are stored in the %ENV hash. -- Jef

Re: 'Use Lib' problem...

2005-07-31 Thread Tony Frasketi
Sorry... I've since discovered that my approach in fact DID NOT solve my problem I inadvertently place my perl module in the SAME directory as my CGI file and of course that would always work. So it looks like I'm back to square one. Still looking for a zimple solution to avoid explicitly n

Re: 'Use Lib' problem...

2005-07-30 Thread Tony Frasketi
Hello Tom I've been successful in getting my use lib statment to work by inserting the following statments in my .bash_profile file as follows CGIDIR=$HOME/cgi-bin PMDIR=$CGIDIR/pm export CGIDIR PMDIR Then in my CGI script I have... -

Re: 'Use Lib' problem...

2005-07-26 Thread Jeff 'japhy' Pinyan
On Jul 26, Tony Frasketi said: $ENV{HOME} = 'home/tony/cgi-bin'; # My cgi-bin directory Are you sure there shouldn't be a / at the beginning of that? use lib "$ENV{HOME}/pm"; # Add my personal perl module directory The problem is that 'use lib' happens at compile-time, but y

Re: 'Use Lib' problem...

2005-07-26 Thread Tom Allison
Tony Frasketi wrote: Hello listers I'm trying to use the following 'use lib' statement as described at http://www.unix.org.ua/orelly/perl/prog3/ch31_13.htm use lib "$ENV{HOME}/libperl"; # add ~/libperl In a *test* program, I've written $ENV{HOME} = 'home/tony/cgi-bin'; # M

RE: use lib - not known at compile time

2004-07-29 Thread Thompson, Glenn
Thanks. Didn't know about PERL5LIB but when it looked it up in the Cookbook its the perfect & easy solution. I just put export PERL5LIB=$RGSE/lib into my .bashrc file and now there is no longer a need to use: perl -I${RGSE}/lib myprogram.pl to run the program. I can just do:

RE: use lib - not known at compile time

2004-07-29 Thread Bakken, Luke
> 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 ru

RE: use lib - not known at compile time

2004-07-29 Thread Bob Showalter
Thompson, Glenn wrote: > 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". > > T

RE: use lib - not known at compile time

2004-07-29 Thread Moon, John
You may wish to look at "BEGIN" ... Hope that gives you some ideas... Thanks, jwm -Original Message- From: Thompson, Glenn [mailto:[EMAIL PROTECTED] Sent: Thursday, July 29, 2004 10:54 AM To: [EMAIL PROTECTED] Subject: use lib - not known at compile time I'm trying to add my own modu

Re: use lib(''); Apache httpd.conf

2004-06-08 Thread Wiggins d Anconia
> Hi, > > I have a rather simple question that Google hasn't produced answers for. > Basically, I am installing Mason in a virtual host under mod_perl. The > libraries I need are housed in ~/my/lib > Really, your exact subject line gave 3-4 pages that provided similar answers at the top of the l

RE: use lib(''); Apache httpd.conf

2004-06-08 Thread NYIMI Jose (BMB)
> -Original Message- > From: Alex Newby [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 08, 2004 9:54 AM > To: [EMAIL PROTECTED] > Subject: use lib(''); Apache httpd.conf > > > Hi, > > I have a rather simple question that Google hasn't produced > answers for. Basically, I am installi

RE: use lib

2004-03-24 Thread Bob Showalter
B. Fongo wrote: > Is it recommendable to use the pragma "use lib " when installing a > program on a server shared by many users? > Assuming my IPS did not install certain CPAN modules which my needs, > and I decide to install them in my www directory. > In such a scenario, putting "use lib" on my s

Re: use lib

2004-03-23 Thread Jenda Krynicky
From: "B. Fongo" <[EMAIL PROTECTED]> > Is it recommendable to use the pragma "use lib " when installing a > program on a server shared by many users? Assuming my IPS did not > install certain CPAN modules which my needs, and I decide to install > them in my www directory. In such a scenario, putti

[ot: "test"] Re: use lib problem

2003-08-02 Thread Randal L. Schwartz
> "Jeff" == Jeff 'Japhy' Pinyan <[EMAIL PROTECTED]> writes: Jeff> On Aug 2, awarsd said: >> #!/usr/bin/perl >> >> use CGI qw(:standard); >> use DBI; >> >> require "/path/to/config.pl"; >> ##inside config.pl it has $dataDir >> ##$dataDir = "/path/to/"; >> use lib $dataDir."Module"; >> use Tes

Re: use lib problem

2003-08-02 Thread Jeff 'japhy' Pinyan
On Aug 2, awarsd said: >#!/usr/bin/perl > >use CGI qw(:standard); >use DBI; > >require "/path/to/config.pl"; > ##inside config.pl it has $dataDir >##$dataDir = "/path/to/"; >use lib $dataDir."Module"; >use Test; You named your module "Test"? That's why you're getting a false positive. There's a

Re: use lib problem

2003-08-02 Thread awarsd
Hi, here is the actual top of the file #!/usr/bin/perl use CGI qw(:standard); use DBI; require "/path/to/config.pl"; ##inside config.pl it has $dataDir ##$dataDir = "/path/to/"; use lib $dataDir."Module"; use Test; ... Should I declare variable i.e my $datDir inside the program or in

Re: use lib problem

2003-08-02 Thread Jeff 'japhy' Pinyan
On Aug 2, awarsd said: >no sorry it is not use but use lib $datadir."Module"; That doesn't change the fact that $datadir does NOT have a value when the 'use' line happens. Is the require() being done in a BEGIN block? If so, you neglected to show us that as well. -- Jeff "japhy" Pinyan [

Re: use lib problem

2003-08-02 Thread awarsd
Hi, no sorry it is not use but use lib $datadir."Module"; just a typo awards "Jeff 'Japhy' Pinyan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Aug 2, awarsd said: > > >I messed around and found that > >if in config i do $datadir = "/my/path/"; > >instead o f$datadir= "/my/pa

Re: use lib problem

2003-08-02 Thread Jeff 'japhy' Pinyan
On Aug 2, awarsd said: >I messed around and found that >if in config i do $datadir = "/my/path/"; >instead o f$datadir= "/my/path"; > >then in my script i do >#!/usr/bin/perl >require 'config.pl'; >use $datadir."Module"; > >everything works again. I don't know how "everything works". You haven't

Re: use lib problem

2003-08-02 Thread awarsd
Hi, I messed around and found that if in config i do $datadir = "/my/path/"; instead o f$datadir= "/my/path"; then in my script i do #!/usr/bin/perl require 'config.pl'; use $datadir."Module"; everything works again. Thanx for the suggestion tough because i didn't know how to use BEGIN now i do

Re: use lib problem

2003-08-02 Thread Jeff 'japhy' Pinyan
On Aug 2, awarsd said: >use lib "/path/to/Module"; >it works just fine >with $dir = '/path/to'; >use lib "$dir/Module"; >it give me an error I also tried use lib qw() but same problem is there a >way to fix the problem?? The problem is that 'use' is a compile-time directive, whereas assigning a

Re: use lib problem

2003-08-02 Thread Li Ngok Lam
- Original Message - From: "awarsd" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, August 02, 2003 10:01 PM Subject: use lib problem > Hi, > > I have a problem maybe it is normal. > My problem is with using lib > now to retrieve my module i do this > use lib "/path/to/Modul

Re: use lib question

2002-02-05 Thread Randal L. Schwartz
> "Jeff" == Jeff 'japhy' Pinyan <[EMAIL PROTECTED]> writes: >> I don't believe @ARGV is set up early enough to do that. I'd be happy >> if that worked, but I'm suspicious. Have you tested this? Jeff> japhy% bleadperl -le 'BEGIN { print "<@ARGV>" }' a b c Jeff> I sit corrected. :) -

Re: use lib question

2002-02-05 Thread Jeff 'japhy' Pinyan
On Feb 5, Randal L. Schwartz said: >> "Jeff" == Jeff 'Japhy' Pinyan <[EMAIL PROTECTED]> writes: > >Jeff> use lib $ARGV[0] eq '-foo' ? "/this/path" : "/that/path"; > >I don't believe @ARGV is set up early enough to do that. I'd be happy >if that worked, but I'm suspicious. Have you tested

Re: use lib question

2002-02-05 Thread Brett W. McCoy
On Tue, 5 Feb 2002, Kingsbury, Michael wrote: > I want to have two different variable for use lib depending on a cmd line > switch (one for the production libraries, one for development libraries). > They exist in different directories. It appears that it uses the use lib at > compilation time,

Re: use lib question

2002-02-05 Thread Randal L. Schwartz
> "Jeff" == Jeff 'Japhy' Pinyan <[EMAIL PROTECTED]> writes: Jeff> use lib $ARGV[0] eq '-foo' ? "/this/path" : "/that/path"; I don't believe @ARGV is set up early enough to do that. I'd be happy if that worked, but I'm suspicious. Have you tested this? -- Randal L. Schwartz - Stonehenge

Re: use lib question

2002-02-05 Thread Jeff 'japhy' Pinyan
On Feb 5, Kingsbury, Michael said: >I want to have two different variable for use lib depending on a cmd line >switch (one for the production libraries, one for development libraries). >They exist in different directories. It appears that it uses the use lib at >compilation time, rendering an if

RE: use lib question

2002-02-05 Thread Bob Showalter
> -Original Message- > From: Kingsbury, Michael [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, February 05, 2002 11:31 AM > To: '[EMAIL PROTECTED]' > Subject: use lib question > > > I want to have two different variable for use lib depending > on a cmd line > switch (one for the production

Re: use lib question

2002-02-05 Thread Jon Molin
use BEGIN: perl -e 'BEGIN {if (`pwd` =~ /some_path/){use lib ("/usr");}else{use lib ("/home");}}' i usually unshift @INC but i've heard that's not a good way to do it, not sure why though. /Jon "Kingsbury, Michael" wrote: > > I want to have two different variable for use lib depending on a cm

Re: use lib directive

2001-05-22 Thread Aaron Craig
I have the same problem with a client of mine -- unfortunately, unless you have your own server, your stuck with their setup. I've gotten around the problem using the I switch in the shebang line: #!/usr/bin/perl -I./lib after than, I can include any module living in my lib directory the same

Fwd: Re: use lib directive

2001-05-21 Thread Peter Cline
> >I seem to have found some resolution to my problem. I am using strict and >had been using the module that resides in the standard libs as follows: > >use NYT::Cnxdb; > >my $cnxdb = NYT::Cnxdb->new > >when I say my $cnxdb = Cnxdb->new >instead, it works. I was assuming that strict would want

Re: use lib directive

2001-05-21 Thread Timothy Kimball
I wrote: : If you did, then did you use the same perl executable to install the : module that you're using to run it? i.e., does 'which perl' eq the : shebang line of your script? If you have two perls on your system : (seems a lot of people do), then it may be that the other module isn't : inst

Re: use lib directive

2001-05-21 Thread Peter Scott
At 02:23 PM 5/21/01 -0400, Peter Cline wrote: >Hello, I am attempting to develop my first module. Because of >permissions/security, etc.. I cannot store the module in the standard >perl lib directories. So it is currently living in a subdir called lib in >my home directory. I use a "use li

Re: use lib directive

2001-05-21 Thread Timothy Kimball
Peter Cline wrote: : Hello, I am attempting to develop my first module. Because of : permissions/security, etc.. I cannot store the module in the standard perl : lib directories. So it is currently living in a subdir called lib in my : home directory. I use a "use lib" directive to add thi

Re: use lib directive

2001-05-21 Thread Carl Rogers
Not being familiar with Sun: Have you tried using the REQUIRE keyword in your script? (require "write_complete_path_here/Modulename.pm") In Win, which I'm forced to use: it's analogous to having your module resided on a shared folder, s, and would be require "s:/folder1/folder2/Modulen