Perl programmer for hire: download my resume (PDF).
John Bokma MexIT
freelance Perl programmer

Case: insensitive

Wednesday, May 18, 2005 | 0 comments

Today when after having sent someone an updated version of a Perl CGI program, I got an email back that even though a required Perl module was installed, the program couldn't find it. I asked if he could send me the exact error report, and also if he could try a one liner:

perl -mMime::Lite -e ""

If you have used the Perl module MIME::Lite before, you probably have spotted the problem by now. And I was lucky: I made the same mistake again since I copied the module name from the Perl script.

I got an email back with the exact error message reported by perl:

Can't locate Mime/Lite.pm in @INC (@INC contains:
/usr/lib/perl5/5.8.5/i386-linux-thread-multi /usr/lib/perl5/5.8.5
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.5
/usr/lib/perl5/vendor_perl/5.8.4/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.4
/usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.3
/usr/lib/perl5/vendor_perl/5.8.2/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.2 /usr/lib/perl5/vendor_perl/5.8.1
/usr/lib/perl5/vendor_perl .).
BEGIN failed--compilation aborted.

Moreover, proof was given that the Perl module was installed:

$ locate Lite.pm
/usr/lib/perl5/vendor_perl/5.8.5/MIME/Lite.pm
:
:

When I copied the location under the line with the same parent directory (of the module) in the error message in order to see if there were any differences, I suddenly noticed my misspelling of MIME:

Can't locate Mime/Lite.pm in @INC (@INC contains:
/usr/lib/perl5/5.8.5/i386-linux-thread-multi /usr/lib/perl5/5.8.5
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.5
/usr/lib/perl5/vendor_perl/5.8.5/MIME/Lite.pm

So I had been bitten by the fact that file and directory names under Windows XP are case-insensitive.

Perl debugging lessons learned

Also today

Please post a comment | read 0 comments | RSS feed