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

'Use Lib' problem...

2005-07-26 Thread Tony Frasketi
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'; # My cgi-bin directory

[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

use lib problem

2003-08-02 Thread awarsd
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/Module"; it works just fine but created a configuration file. with $dir = '/path/to'; and when i do use lib "$dir/Module"; it give me an error I also tried use lib qw() but s