Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Module is in %INC, but names are not recognized

by emgrasso (Novice)
on Sep 12, 2008 at 23:24 UTC ( #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: => C:/Program Files/Rational/Common/lib/perl5/5.8.6/MSWin32-x86-mult
warnings/ => C:/Program Files/Rational/Common/lib/perl5/5.8.6/warning
s/ => C:/Program Files/Rational/Common/lib/perl5/5.8.6/
File/ => C:/Program Files/Rational/Common/lib/perl5/5.8.6/File/ => C:/Program Files/Rational/Common/lib/perl5/5.8.6/MSWin32-x86-multi-
thread/ => C:/Program Files/Rational/Common/lib/perl5/5.8.6/
Exporter/ => C:/Program Files/Rational/Common/lib/perl5/5.8.6/Exporter/H => install/../etc/
File/Spec/ => C:/Program Files/Rational/Common/lib/perl5/5.8.6/File/Spec/ => C:/Program Files/Rational/Common/lib/perl5/5.8.6/ => C:/Program Files/Rational/Common/lib/perl5/5.8.6/ => C:/Program Files/Rational/Common/lib/perl5/5.8.6/
File/ => C:/Program Files/Rational/Common/lib/perl5/5.8.6/File/ => C:/Program Files/Rational/Common/lib/perl5/5.8.6/MSWin32-x86-multi-thr
ead/ => install/../etc/
File/Spec/ => C:/Program Files/Rational/Common/lib/perl5/5.8.6/File/Spec
/ => install/../etc/
Undefined subroutine &main::cwd called at install\ 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 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?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2023-06-11 01:18 GMT
Find Nodes?
    Voting Booth?
    How often do you go to conferences?

    Results (40 votes). Check out past polls.