Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Module is in %INC, but names are not recognized

by emgrasso (Novice)
on Sep 12, 2008 at 23:24 UTC ( [id://711038]=perlquestion: print w/replies, xml ) Need Help??

emgrasso has asked for the wisdom of the Perl Monks concerning the following question:

This snippet of code:

use ClearConn;
use ClearConnDBs;
use ClearConnVobs;
use CWD;
use File::Copy;
#print "\@INC is @INC\n";
print map {"$_ => $INC{$_}\n"} keys %INC;
my $pwd=cwd();
print $pwd."\n";

is producing the following output:

XSLoader.pm => C:/Program Files/Rational/Common/lib/perl5/5.8.6/MSWin32-x86-mult
i-thread/XSLoader.pm
warnings/register.pm => C:/Program Files/Rational/Common/lib/perl5/5.8.6/warning
s/register.pm
warnings.pm => C:/Program Files/Rational/Common/lib/perl5/5.8.6/warnings.pm
File/Copy.pm => C:/Program Files/Rational/Common/lib/perl5/5.8.6/File/Copy.pm
Config.pm => C:/Program Files/Rational/Common/lib/perl5/5.8.6/MSWin32-x86-multi-
thread/Config.pm
Carp.pm => C:/Program Files/Rational/Common/lib/perl5/5.8.6/Carp.pm
Exporter/Heavy.pm => C:/Program Files/Rational/Common/lib/perl5/5.8.6/Exporter/H
eavy.pm
ClearConnVobs.pm => install/../etc/ClearConnVobs.pm
File/Spec/Unix.pm => C:/Program Files/Rational/Common/lib/perl5/5.8.6/File/Spec/
Unix.pm
strict.pm => C:/Program Files/Rational/Common/lib/perl5/5.8.6/strict.pm
Exporter.pm => C:/Program Files/Rational/Common/lib/perl5/5.8.6/Exporter.pm
vars.pm => C:/Program Files/Rational/Common/lib/perl5/5.8.6/vars.pm
File/Spec.pm => C:/Program Files/Rational/Common/lib/perl5/5.8.6/File/Spec.pm
CWD.pm => C:/Program Files/Rational/Common/lib/perl5/5.8.6/MSWin32-x86-multi-thr
ead/CWD.pm
ClearConn.pm => install/../etc/ClearConn.pm
File/Spec/Win32.pm => C:/Program Files/Rational/Common/lib/perl5/5.8.6/File/Spec
/Win32.pm
ClearConnDBs.pm => install/../etc/ClearConnDBs.pm
Undefined subroutine &main::cwd called at install\ClearConnConfig.pl line 57.

So perl is finding the module, but not actually using it. The three ClearConn modules with the relative paths are being both seen and used correctly. I don't know about the other libraries with absolute paths (File::Copy was being flakey yesterday when CWD was working ok.)

C:\ClearConn>cqperl -ver

This is perl, v5.8.6 built for MSWin32-x86-multi-thread

Rebooting the windows box did not help. This script was running cwd fine yesterday, and I can't think of any changes I have made that would affect the namespace.

I'd appreciate any hints for things to look at, or ways to get things working again.

  • Comment on Module is in %INC, but names are not recognized

Replies are listed 'Best First'.
Re: Module is in %INC, but names are not recognized
by rhesa (Vicar) on Sep 12, 2008 at 23:57 UTC
      To elaborate, an annoying compatibility issue between Perl and Windows is that Windows filenames are case-insensitive, while module names are not. So while it can find CWD.pm and load it, it can't import the module CWD because it's named Cwd.

      It does seem like Perl should at least emit a warning for this. You're certainly not the first person to be tripped up by it.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://711038]
Approved by lamp
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (8)
As of 2024-04-19 09:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found