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
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
>
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
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://
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
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
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
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
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...
-
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
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
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:
> 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
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
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
> 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
> -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
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
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
> "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
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
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
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 [
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
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
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
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
- 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
> "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. :)
-
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
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,
> "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
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
> -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
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
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
>
>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
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
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
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
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
41 matches
Mail list logo