While running the Cygwin updater, I allowed it to upgrade my version of perl from 5.30 to 5.32. Now when I try to run perl scripts, I receive errors related to module locations. Here is a sample program:


#!/usr/bin/perl -w use strict; use WWW::Mechanize; printf("foo\n");

Here is the output:


Can't locate WWW/Mechanize.pm in @INC (you may need to install the WWW +::Mechanize module) (@INC contains: /home/Special_K/perl_modules /usr +/local/lib/perl5/site_perl/5.32/x86_64-cygwin-threads /usr/local/shar +e/perl5/site_perl/5.32 /usr/lib/perl5/vendor_perl/5.32/x86_64-cygwin- +threads /usr/share/perl5/vendor_perl/5.32 /usr/lib/perl5/5.32/x86_64- +cygwin-threads /usr/share/perl5/5.32) at ./test.pl line 3. BEGIN failed--compilation aborted at ./test.pl line 3.

After searching for help I modified my code to the following:


#!/usr/bin/perl5.30.3 -w use strict; use WWW::Mechanize; printf("foo\n");

Now the output is as follows:


Can't locate strict.pm in @INC (you may need to install the strict mod +ule) (@INC contains: /home/Special_K/perl_modules /usr/local/lib/perl +5/site_perl/5.30/x86_64-cygwin-threads /usr/local/share/perl5/site_pe +rl/5.30 /usr/lib/perl5/vendor_perl/5.30/x86_64-cygwin-threads /usr/sh +are/perl5/vendor_perl/5.30 /usr/lib/perl5/5.30/x86_64-cygwin-threads +/usr/share/perl5/5.30) at ./test.pl line 2. BEGIN failed--compilation aborted at ./test.pl line 2.

I'm not sure how to fix this. How do I locate strict.pm?

Also here are some related questions:

1. If I install a new version of perl, do I need to install new copies of every module that was installed for the prior version of perl I was using?

2. If I install a new version of perl but I want some scripts to use the prior version of perl, do I need to manually edit each of those scripts to point to the old version, as I have done in my second sample code block above?


In reply to help fixing module paths after upgrading perl in cygwin by Special_K

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.