Re: use lib question
> "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. :) -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: use lib question
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 this? japhy% bleadperl -le 'BEGIN { print "<@ARGV>" }' a b c -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ ** Look for "Regular Expressions in Perl" published by Manning, in 2002 ** what does y/// stand for? why, yansliterate of course. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: use lib question
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, rendering an if statement useless. Anyone have a slick > way of doing this? You could always use the -M switch on the command-line to choose which module to use for the script. -- Brett http://www.chapelperilous.net/ There's no point in being grown up if you can't be childish sometimes. -- Dr. Who -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: use lib question
> "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 Consulting Services, Inc. - +1 503 777 0095 <[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: use lib question
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 statement useless. Anyone have a slick >way of doing this? use lib $ARGV[0] eq '-foo' ? "/this/path" : "/that/path"; -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ ** Look for "Regular Expressions in Perl" published by Manning, in 2002 ** what does y/// stand for? why, yansliterate of course. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: use lib question
> -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 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 slick > way of doing this? You can also set the PERL5LIB environment variable to point to the proper libraries. (See the caveats in perldoc perlrun). -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: use lib question
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 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 slick > way of doing this? > > -mike > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]