Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ambiguous call Cwd.pm not using it

Status
Not open for further replies.

derekpc

Technical User
Jul 3, 2001
44
0
0
GB
I am getting a very puzzling warning message from one of my CGI scripts and am not sure how to debug. The warning is:
[tt]
Cwd.pm: Ambiguous call resolved as CORE::chdir(), qualify as such or use & at /local/perl/lib/Cwd.pm line 306
[/tt]

I also get a repeat of the error for line 308 of Cwd.pm

The reason I find this puzzling is that the script that is generating this warning is neither using Cwd.pm nor is there an attempt to chdir anywhere in the script.

I assume that it may be coming from one of the other modules that the script is using (strict, CGI, Carp, lib, File (Basename and Copy) and Time (gmtime and local), but I can't think of any of those that might do a chdir (I checked Basename and Copy, not in there).

Does anyone know how to determine where in the initial script the warning is being generated from?

Derek
 
In the version of cwd.pm on my machine (activeperl) this is a few lines starting at 302:
Code:
sub fast_abs_path {
    my $cwd = getcwd();
    my $path = @_ ? shift : '.';
    CORE::chdir($path) || croak "Cannot chdir to $path:$!";
    my $realpath = getcwd();
    CORE::chdir($cwd)  || croak "Cannot chdir back to $cwd:$!";
    $realpath;
}
Looks like in this version there is an explicit CORE::chdir, while your version may not have that. You might want to see if there's a new version of CWD.pm.
Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Thanks Tracy. Problem is, I am not using Cwd.pm which is what is driving me nuts about this error message. Is Cwd.pm used whether there is an explicit [tt]use Cwd[/tt] statement or not?
Derek
 
ExtUtils/liblist.pm and Pod/perlcygwin.pm explicitly use it. There are quite a few modules that use ExtUtils too. That's all I've been able to determine in a quick scan of my standard install, but obviously the libraries nest a lot.
Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Thanks for the tips Tracy. I'll dig through and track it down when I get the time. Everything still seems to work as I expect so I will have to press on for now.
Derek
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top