A couple of months back I installed Cygwin and MySQL (from an MSI Win install) on Vista. I also installed DBI, DBDmysql and the MySQL drivers. For a while DBI was working happily and I was able to access the database through Perl scripts with use DBI.

Recently I looked at some older scripts and discovered that DBI no longer works.

$ perl -e 'use DBI'; Can't locate DBI.pm in @INC (@INC contains: /usr/lib/perl5/5.10/i686-cygwin /usr/lib/perl5/5.10 /usr/lib/perl5/site_perl/5.10/i686-cygwin /usr/lib/perl5/site_perl/5.10 /usr/lib/perl5/vendor_perl/5.10/i686-cygwin /usr/lib/perl5/vendor_perl/5.10 /usr/lib/perl5/vendor_perl/5.10 /usr/lib/perl5/site_perl/5.8 /usr/lib/perl5/vendor_perl/5.8 .) at -e line 1.
I ran a search for DBI.pm on my local machine and it finds the following:
C:\cygwin\home\me\.cpan\build\DBI-1.601\blib\lib C:\cygwin\home\me\.cpan\build\DBI-1.601 C:\cygwin\lib\perl5\site_perl\5.8\cygwin C:\cygwin\home\me\.cpan\build\DBI-1.601\blib\lib\Bundle C:\cygwin\home\me\.cpan\build\DBI-1.601\lib\Bundle C:\cygwin\lib\perl5\site_perl\5.8\cygwin\Bundle
Does that fact that DBI.pm is in C:\cygwin\lib\perl5\site_perl\5.8\cygwin instead of \usr\lib\perl5\site_perl\5.8 (without specifying cygwin) really matter - doesn't @INC drill down recursively into the folders?

The permissions in the former folder (that contain the sub folder cygwin; that contains DBI.pm) are as follows:
me@me-cmp /usr/lib/perl5/site_perl/5.8 $ ll total 8 drwxrwxrwx+ 9 me Users 4096 Apr 13 21:05 . drwxrwxrwx+ 4 me Users 0 Jul 21 23:20 .. drwxr-xr-x+ 3 me Power Users 0 Jan 9 2008 File drwxr-xr-x+ 2 me Power Users 0 Jan 9 2008 Number drwxr-xr-x+ 2 me Power Users 0 Apr 13 21:04 OLE drwxr-xr-x+ 2 me Power Users 0 Apr 13 21:04 Parse drwxr-xr-x+ 3 me Power Users 0 Apr 13 21:05 Spreads drwxr-xr-x+ 2 me Power Users 0 Jan 9 2008 Text drwxrwxrwx+ 7 me Users 4096 Jul 21 23:18 cygwin
Cygwin has a different group owner and slightly different permissions but nothing really bad right?

If I cd into C:\cygwin\lib\perl5\site_perl\5.8\cygwin and rerun $ perl -e 'use DBI';
me@me-cmp /usr/lib/perl5/site_perl/5.8/cygwin $ perl -e 'use DBI'; Can't load './auto/DBI/DBI.dll' for module DBI: No such file or direct +ory at /usr/lib/perl5/5.10/i686-cygwin/DynaLoader.pm line 201. at DBI.pm line 266 BEGIN failed--compilation aborted at DBI.pm line 266. Compilation failed in require at -e line 1. BEGIN failed--compilation aborted at -e line 1.
Seems to me that for some reason some folders and files that are there can't be found - is this a permissions thing?

I tried adding C:\cygwin\lib\perl5 to the Windows Environment Variable - no joy. I also added a new PERL5LIB variable with the same value - no joy.

I'd rather not reinstall Cygwin and MySQL. Does anyone have any advice?

Thanks in advance o wise and experienced monks.

In reply to Can't locate DBI.pm @INC (Cygwin + MySQL) by w0rf

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.