> -----Original Message-----
> From: Yeung Siu [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 17, 2002 5:48 PM
> To: [EMAIL PROTECTED]
> Subject: module directory problem
> 
> 
> Hi all,
> 
> I have problem with directory environment. The scripts
> are on a NT system using Active Perl v5.6.1. I have
> one script at 
> 
> foo\test.pl
> 
> and use package at
> 
> tools\tools.pm
> 
> 
> I imported the tools.pm to test.pl during this
> 
> # in test.pl script
> use lib '../tools';
> use TOOLS;
> 
> 
> The tools.pm has the following:
> 
> # in tools.pm
> package TOOLS;
> use Cwd;
> 
> $dir = cwd();  ### get the path of the current
> directory
> print "$dir\n";
> 
> 1;
> 
> The problem is that the value of $dir is "foo\" and
> not "tools\" even "tools.pm" in the "tools\". This is
> a problem since I need to access files with data in
> "tools\" from the tools.pm script. Are there anyway to
> solve the module import problem? Thanks =D

Use the special literal __FILE__ to get the path to tools.pm

This symbol is documented in perldoc perldata

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to