Hi Marc,
On Thu, 21 Jul 2011 08:40:44 -0700
Marc wrote:
> On Jul 21, 2011, at 5:56 AM, Shlomi Fish wrote:
>
> > You can load modules from lib using "use Module::SubModule;" or "use
> > Params::Validate" - no need to load all subdirectories. Just use "::" for
> > loading stuff in sub-directorie
On Jul 21, 2011, at 5:56 AM, Shlomi Fish wrote:
> You can load modules from lib using "use Module::SubModule;" or "use
> Params::Validate" - no need to load all subdirectories. Just use "::" for
> loading stuff in sub-directories.
Thanks, Shlomi. That's all it took to get it to sink i
Hi Marc,
On Wed, 20 Jul 2011 15:38:06 -0700
Marc wrote:
> I'd like to organize a project's files into subdirectories for better
> housekeeping. I thought that use lib "."; would also include any
> subdirectories, but sadly it doesn't. Is there a wa
I'd like to organize a project's files into subdirectories for better
housekeeping. I thought that use lib "."; would also include any
subdirectories, but sadly it doesn't. Is there a way to include all subdirs
without having a list a mile long like this?
us
Hi Mimi,
On Monday 12 Apr 2010 02:32:12 Mimi Cafe wrote:
> My program is in the same directory as my module directory, but when I use
> relative path in use lib, Perl doesn't find the module.
>
>
>
> use lib qw(MyModule/), use lib qw(./MyModule/), use lib qw(My
My program is in the same directory as my module directory, but when I use
relative path in use lib, Perl doesn't find the module.
use lib qw(MyModule/), use lib qw(./MyModule/), use lib qw(MyModule) or use
lib qw(./MyModule/) # these don't work.
use lib qw(/var/www/cgi-bin
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 t
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 adop
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
will allow the code to be ported between OS
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( /
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://
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_modules/live );
once the modules are in liv
ical - file, it
fails.
I've tried FindLib-again as well as pretty much everything I've seen
online. There's a level of
use FindBin qw($Bin);
use lib "$Bin/Libs";
'use lib' doesn't load your library files; it just tells Perl where to
find them. You still
omething work only on
some invocations of your program? Once you can get it to work, doesn't
it keep working?
use FindBin qw($Bin);
use lib "$Bin/Libs";
'use lib' doesn't load your library files; it just tells Perl where to
find them. You still need to load them (e
dScripts (dir)
myScript.pl
Libs (dir)
Lib1.pl, etc
I'm using the following (at the moment) to include them:
use FindBin qw($Bin);
use lib "$Bin/Libs";
I consistently get errors like so: Undefined subroutine
&main::route_get_hash called at ./ReadSingleTable.pl line 114.
Tom Phoenix am Mittwoch, 15. Februar 2006 01.59:
> On 2/14/06, Hans Meier (John Doe) <[EMAIL PROTECTED]> wrote:
> > I'm fine with that, but still don't understand how a path present in @INC
> > is ignored.
>
> It sure looks like it's in @INC, from the message. (You may know that
> PERL5LIB is somet
On 2/14/06, Hans Meier (John Doe) <[EMAIL PROTECTED]> wrote:
> I'm fine with that, but still don't understand how a path present in @INC is
> ignored.
It sure looks like it's in @INC, from the message. (You may know that
PERL5LIB is sometimes ignored for security reasons, but it's not
ignored if
t; But why? The file is there:
>
> # ls /opt/smf/lib/SMF/Config.pm
> /opt/smf/lib/SMF/Config.pm
>
> and the path is obviously in @INC.
>
> The error appears after replacing use lib '/opt/smf/lib';
> in the httpd_startup.pl with PERL5LIB="/opt/smf/li
fig.pm
and the path is obviously in @INC.
The error appears after replacing use lib '/opt/smf/lib';
in the httpd_startup.pl with PERL5LIB="/opt/smf/lib"
in the init.d script. Before, everything went well, and I changed nothing
else.
I checked permissions, copied&
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
I
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 unsubscrib
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
ed.
Thanks
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...
----
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
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
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
$
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/to
n just do:
myprogram.pl
instead.
It does seem that:
use Env qw(RGSE);
use lib "$ENV{RGSE}/lib";
should also work though. Works fine as a 2 line program, as Bob Showalter suggested.
So for whatever reason, $ENV{RGSE} is not properly defined in my more complex program.
S
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"
Couldn't you use the PERL5LIB environment variable? I think that's what
it'
s 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
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 tryin
ot;.
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 prog
swers at the top of the listing...
> How might I make Apache aware of ~/my/lib from the httpd.conf so that the
> following:
>
> PerlModule HTML::Mason::ApacheHandler
>
> will load? What is the equivalent for the httpd.conf of use
> lib('/my/lib'); ?
>
> -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
HTML::Mason::ApacheHandler
will load? What is the equivalent for the httpd.conf of use
lib('/my/lib'); ?
Thanks is advance.
-
Sincerely,
Alex Newby
E-mail: [EMAIL PROTECTED]
Website: http://www.alexnewby.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
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
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 i
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
>>>>> "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";
>> ##in
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 &q
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
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 we
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 d
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
i didn't know how to use BEGIN now i
do :-
Awards
"Jeff 'Japhy' Pinyan" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Aug 2, awarsd said:
>
> >use lib "/path/to/Module";
> >it works just fine
>
> >with $d
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 '
- 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
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
my $PERLVER =
my ($uname_s, $uname_r) = (POSIX::uname())[0,2];
my @crank = qw!$PERLVER/sun4-solaris site_perl/$PERLVER/sun4-solaris
site_perl/$PERLVER/!;
my $top = "/var/opt/modules/$uname_s/$uname_r";
foreach my
naLoader cannot find Kstat.so in
/var/opt/modules/SunOS/5.6/$archname/auto/Kstat/
as documented in the use lib perldoc.
Can't locate loadable object for module Solaris::Kstat in @INC (@INC
contains: /var/opt/modules/SunOS/5.6
/var/opt/local/lib/perl5/5.00503/sun4-solaris
/var/opt/local/li
On Thu, Mar 07, 2002 at 05:22:09PM -0500, Nikola Janceski wrote:
> nope that doesn't work.. tried it.
> it doesn't like that you are passing use lib a var
It doesn't?
> perl -wle 'BEGIN { $lib = "foo" } use lib $lib; $, = "\n"; print @INC;
nope that doesn't work.. tried it.
it doesn't like that you are passing use lib a var
but this does work, but don't know how you would put a subroutine in there.
BEGIN {
our @INC;
my $libdir = "/libpath";
unshift(@INC, $libdir)
}
-Original Message-
From: Wa
From: "Carl Schoeneman" <[EMAIL PROTECTED]>
> I'm using "use lib" dynamically:
>
> $script_dir = get_lib();
> use lib "$script_dir";
>
> This works but generates the warning "Empty compile time valu
Works great. Thank you.
You're correct about it not working like I had said it was. The module was
in the same directory as the script so was found regardless of the "use lib"
statement not working.
-Original Message-
From: Jeff 'japhy' Pinyan [mailt
On Mar 7, Carl Schoeneman said:
>I'm using "use lib" dynamically:
>
>$script_dir = get_lib();
>use lib "$script_dir";
>
>This works but generates the warning "Empty compile time value given to use
>lib." Is there any way to supres
EMAIL PROTECTED]
Subject: Empty compile time value given to use lib
Hola,
I'm using "use lib" dynamically:
$script_dir = get_lib();
use lib "$script_dir";
This works but generates the warning "Empty compile time value given to use
lib." Is there any way t
8 PM
To: [EMAIL PROTECTED]
Subject: Empty compile time value given to use lib
Hola,
I'm using "use lib" dynamically:
$script_dir = get_lib();
use lib "$script_dir";
This works but generates the warning "Empty compile time value given to use
lib." Is there
Hola,
I'm using "use lib" dynamically:
$script_dir = get_lib();
use lib "$script_dir";
This works but generates the warning "Empty compile time value given to use
lib." Is there any way to supress this message without disabling warnings
entirely?
Th
> "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 u
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
> comp
>>>>> "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 happ
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,
> -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
>
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 t
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 statement useless. Anyone have a
try mjd's article:
http://perl.plover.com/FAQs/Namespaces.html
hth,
Jos Boumans
> Whoo-hoo! Thanks again for a lightning-quick and highly useful solution.
>
> Perhaps I should re-read what Programming Perl has to say about variable
> scoping. Any other recommended reading?
--
To unsubscr
;>Okay, that worked great until I added 'use strict vars'. Code now reads:
>
>Put a my ($LIB_LOC, $DEV_OR_PROD) outside (and before) the BEGIN block.
>
>>BEGIN {
>> $DEV_OR_PROD = 'dev';
>> $LIB_LOC = "path/" . $DEV_OR_PROD . "/l
On Jul 15, Ted Behling said:
>Okay, that worked great until I added 'use strict vars'. Code now reads:
Put a my ($LIB_LOC, $DEV_OR_PROD) outside (and before) the BEGIN block.
>BEGIN {
> $DEV_OR_PROD = 'dev';
> $LIB_LOC = "path/" . $DEV_OR_PROD . &
Okay, that worked great until I added 'use strict vars'. Code now reads:
BEGIN {
$DEV_OR_PROD = 'dev';
$LIB_LOC = "path/" . $DEV_OR_PROD . "/lib";
}
use strict vars;
use lib "/foo/$LIB_LOC";
require 'file-to-include.pl';
pri
On Jul 15, Ted Behling said:
>$DEV_OR_PROD = 'dev';
>$LIB_LOC = "path/" . $DEV_OR_PROD . "/lib";
>print $LIB_LOC . "\n";
>require 'file-to-include.pl';
Those four happen at RUN-TIME.
>use lib "/foo/$LIB_LOC/bar";
T
Hi all,
I'm trying to include a different file in a program depending on whether
it's in a development or production environment, but the 'use lib'
parameter doesn't include the value of the variable I want it to
interpolate. I'm running the following simplified
pting 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 this directory to
>@INC
gt;Thanks for your suggestions.
>
>
>
>At 03:04 PM 5/21/01 -0400, you wrote:
>
>>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
>>: l
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
I use a "use lib" directive to add this directory to
>@INC. this works , but when I try then to use another module that does
>reside in the standard lib directories, I get a "Can't locate object
>method "new" in module "X" at path-specified-
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" direct
gt;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 this directory to
>@INC. this works , but when I try then to use another module that does
>reside in the standard lib directories, I get a &quo
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 this directory to
@
79 matches
Mail list logo