Click here to get back home

Current Directory when test.pl runs ?

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Current Directory when test.pl runs ? Peter Billam 12-14-2004
Posted by Peter Billam on December 14, 2004, 9:31 am
Please log in for more thread options
Greetings. When test.pl is invoked, by all the various things
that invoke it, is it reliably in the current directory ?

I'd like to be able to say (in test.pl) e.g.

require './Bar.pm'; import Foo::Bar;

so that when I'm editing and debugging Bar.pm I know I'm testing my
latest work.

Or should I use simply

use Foo::Bar;

but then not be quite sure if I'm testing a previously installed version ?
OTOH, this does allow testing the installed version on purpose, with

cd ; perl /home/wherever/Foo-Bar-1.01/test.pl

What's the recommended useage (or requireage) in test.pl ?

--

Regards, Peter

Peter Billam, DPIWE/ILS/CIT/Servers, hbt/lnd/l8, 6233 3061


Posted by Brian McCauley on December 14, 2004, 11:32 pm
Please log in for more thread options
Peter Billam wrote:

> Greetings. When test.pl is invoked, by all the various things
> that invoke it, is it reliably in the current directory ?

No.
>
> I'd like to be able to say (in test.pl) e.g.
>
> require './Bar.pm'; import Foo::Bar;
> so that when I'm editing and debugging Bar.pm I know I'm testing my
> latest work.


> Or should I use simply
>
> use Foo::Bar;
>
> but then not be quite sure if I'm testing a previously installed version ?

When testing you should simply set PERL5LIB



Similar ThreadsPosted
Traverse a directory July 13, 2006, 2:10 pm
Glob and Traversing Directory July 14, 2006, 12:13 pm
New Script Directory needs your scripts listed September 3, 2005, 6:32 pm
Modules not installing to standard LIB directory November 17, 2005, 8:14 am
CGI open of tmpfile: No such file or directory March 25, 2008, 6:00 am
Directory for site-packaged module man pages December 15, 2004, 2:55 pm
Loading Perl Modules from same directory as script February 13, 2006, 5:27 pm
Loading Perl Modules from same directory as script February 13, 2006, 5:35 pm
Net::Telnet => Will cd ( change directory ) command work ? February 27, 2006, 3:44 am
permssion denied reading mqueue directory June 14, 2006, 12:58 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap