Just to confirm, I'm using "perl 5, version 24, subversion 2 (v5.24.2) built for MSWin32-x64-multi-thread"

The code at the error in Utils.pm is

use constant is_perl55 => ($] < 5.005_50); use constant is_perl56 => ($] < 5.007 && $] > 5.005_50); use constant is_sane_perl => $] > 5.007;

I have browsed the lib files but I don't see where "strict subs" is set. Also, my code was working as of 11/24/17.

The output from the code you provided is:

Bareword "is_perl56" not allowed while "strict subs" in use at C:/Perl +64/lib/ExtUtils/Constant/Utils.pm line 51. Bareword "is_perl55" not allowed while "strict subs" in use at C:/Perl +64/lib/ExtUtils/Constant/Utils.pm line 74. Bareword "is_sane_perl" not allowed while "strict subs" in use at C:/P +erl64/lib/ExtUtils/Constant/Utils.pm line 116. Bareword "is_perl55" not allowed while "strict subs" in use at C:/Perl +64/lib/ExtUtils/Constant/Utils.pm line 123. Compilation failed in require at /Perl64/lib/ExtUtils/constant.pm line + 100. ExtUtils::Constant::BEGIN() called at /Perl64/lib/ExtUtils/con +stant.pm line 100 eval {...} called at /Perl64/lib/ExtUtils/constant.pm line 100 require constant.pm called at C:/Perl64/lib/Data/Dumper.pm lin +e 279 Data::Dumper::BEGIN() called at /Perl64/lib/ExtUtils/constant. +pm line 100 eval {...} called at /Perl64/lib/ExtUtils/constant.pm line 100 require Data/Dumper.pm called at /Perl64/lib/ExtUtils/Config.p +m line 6 ExtUtils::Config::BEGIN() called at /Perl64/lib/ExtUtils/const +ant.pm line 100 eval {...} called at /Perl64/lib/ExtUtils/constant.pm line 100 require Config.pm called at C:/Perl64/lib/Tie/RefHash.pm line +104 Tie::RefHash::BEGIN() called at /Perl64/lib/ExtUtils/constant. +pm line 100 eval {...} called at /Perl64/lib/ExtUtils/constant.pm line 100 require Tie/RefHash.pm called at C:/Perl64/lib/WWW/Mechanize.p +m line 11 WWW::Mechanize::BEGIN() called at /Perl64/lib/ExtUtils/constan +t.pm line 100 eval {...} called at /Perl64/lib/ExtUtils/constant.pm line 100 require WWW/Mechanize.pm called at test.pl line 5 main::BEGIN() called at /Perl64/lib/ExtUtils/constant.pm line +100 eval {...} called at /Perl64/lib/ExtUtils/constant.pm line 100 BEGIN failed--compilation aborted at /Perl64/lib/ExtUtils/constant.pm +line 100. at /Perl64/lib/ExtUtils/constant.pm line 100. require constant.pm called at C:/Perl64/lib/Data/Dumper.pm lin +e 279 Data::Dumper::BEGIN() called at /Perl64/lib/ExtUtils/constant. +pm line 100 eval {...} called at /Perl64/lib/ExtUtils/constant.pm line 100 require Data/Dumper.pm called at /Perl64/lib/ExtUtils/Config.p +m line 6 ExtUtils::Config::BEGIN() called at /Perl64/lib/ExtUtils/const +ant.pm line 100 eval {...} called at /Perl64/lib/ExtUtils/constant.pm line 100 require Config.pm called at C:/Perl64/lib/Tie/RefHash.pm line +104 Tie::RefHash::BEGIN() called at /Perl64/lib/ExtUtils/constant. +pm line 100 eval {...} called at /Perl64/lib/ExtUtils/constant.pm line 100 require Tie/RefHash.pm called at C:/Perl64/lib/WWW/Mechanize.p +m line 11 WWW::Mechanize::BEGIN() called at /Perl64/lib/ExtUtils/constan +t.pm line 100 eval {...} called at /Perl64/lib/ExtUtils/constant.pm line 100 require WWW/Mechanize.pm called at test.pl line 5 main::BEGIN() called at /Perl64/lib/ExtUtils/constant.pm line +100 eval {...} called at /Perl64/lib/ExtUtils/constant.pm line 100 Compilation failed in require at C:/Perl64/lib/Data/Dumper.pm line 279 +. at C:/Perl64/lib/Data/Dumper.pm line 279. Data::Dumper::BEGIN() called at C:/Perl64/lib/Data/Dumper.pm l +ine 279 eval {...} called at C:/Perl64/lib/Data/Dumper.pm line 279 require Data/Dumper.pm called at /Perl64/lib/ExtUtils/Config.p +m line 6 ExtUtils::Config::BEGIN() called at C:/Perl64/lib/Data/Dumper. +pm line 279 eval {...} called at C:/Perl64/lib/Data/Dumper.pm line 279 require Config.pm called at C:/Perl64/lib/Tie/RefHash.pm line +104 Tie::RefHash::BEGIN() called at C:/Perl64/lib/Data/Dumper.pm l +ine 279 eval {...} called at C:/Perl64/lib/Data/Dumper.pm line 279 require Tie/RefHash.pm called at C:/Perl64/lib/WWW/Mechanize.p +m line 11 WWW::Mechanize::BEGIN() called at C:/Perl64/lib/Data/Dumper.pm + line 279 eval {...} called at C:/Perl64/lib/Data/Dumper.pm line 279 require WWW/Mechanize.pm called at test.pl line 5 main::BEGIN() called at C:/Perl64/lib/Data/Dumper.pm line 279 eval {...} called at C:/Perl64/lib/Data/Dumper.pm line 279 BEGIN failed--compilation aborted at C:/Perl64/lib/Data/Dumper.pm line + 279. at C:/Perl64/lib/Data/Dumper.pm line 279. require Data/Dumper.pm called at /Perl64/lib/ExtUtils/Config.p +m line 6 ExtUtils::Config::BEGIN() called at C:/Perl64/lib/Data/Dumper. +pm line 279 eval {...} called at C:/Perl64/lib/Data/Dumper.pm line 279 require Config.pm called at C:/Perl64/lib/Tie/RefHash.pm line +104 Tie::RefHash::BEGIN() called at C:/Perl64/lib/Data/Dumper.pm l +ine 279 eval {...} called at C:/Perl64/lib/Data/Dumper.pm line 279 require Tie/RefHash.pm called at C:/Perl64/lib/WWW/Mechanize.p +m line 11 WWW::Mechanize::BEGIN() called at C:/Perl64/lib/Data/Dumper.pm + line 279 eval {...} called at C:/Perl64/lib/Data/Dumper.pm line 279 require WWW/Mechanize.pm called at test.pl line 5 main::BEGIN() called at C:/Perl64/lib/Data/Dumper.pm line 279 eval {...} called at C:/Perl64/lib/Data/Dumper.pm line 279 Compilation failed in require at /Perl64/lib/ExtUtils/Config.pm line 6 +. at /Perl64/lib/ExtUtils/Config.pm line 6. ExtUtils::Config::BEGIN() called at /Perl64/lib/ExtUtils/Confi +g.pm line 6 eval {...} called at /Perl64/lib/ExtUtils/Config.pm line 6 require Config.pm called at C:/Perl64/lib/Tie/RefHash.pm line +104 Tie::RefHash::BEGIN() called at /Perl64/lib/ExtUtils/Config.pm + line 6 eval {...} called at /Perl64/lib/ExtUtils/Config.pm line 6 require Tie/RefHash.pm called at C:/Perl64/lib/WWW/Mechanize.p +m line 11 WWW::Mechanize::BEGIN() called at /Perl64/lib/ExtUtils/Config. +pm line 6 eval {...} called at /Perl64/lib/ExtUtils/Config.pm line 6 require WWW/Mechanize.pm called at test.pl line 5 main::BEGIN() called at /Perl64/lib/ExtUtils/Config.pm line 6 eval {...} called at /Perl64/lib/ExtUtils/Config.pm line 6 BEGIN failed--compilation aborted at /Perl64/lib/ExtUtils/Config.pm li +ne 6. at /Perl64/lib/ExtUtils/Config.pm line 6. require Config.pm called at C:/Perl64/lib/Tie/RefHash.pm line +104 Tie::RefHash::BEGIN() called at /Perl64/lib/ExtUtils/Config.pm + line 6 eval {...} called at /Perl64/lib/ExtUtils/Config.pm line 6 require Tie/RefHash.pm called at C:/Perl64/lib/WWW/Mechanize.p +m line 11 WWW::Mechanize::BEGIN() called at /Perl64/lib/ExtUtils/Config. +pm line 6 eval {...} called at /Perl64/lib/ExtUtils/Config.pm line 6 require WWW/Mechanize.pm called at test.pl line 5 main::BEGIN() called at /Perl64/lib/ExtUtils/Config.pm line 6 eval {...} called at /Perl64/lib/ExtUtils/Config.pm line 6 Compilation failed in require at C:/Perl64/lib/Tie/RefHash.pm line 104 +. at C:/Perl64/lib/Tie/RefHash.pm line 104. Tie::RefHash::BEGIN() called at C:/Perl64/lib/Tie/RefHash.pm l +ine 104 eval {...} called at C:/Perl64/lib/Tie/RefHash.pm line 104 require Tie/RefHash.pm called at C:/Perl64/lib/WWW/Mechanize.p +m line 11 WWW::Mechanize::BEGIN() called at C:/Perl64/lib/Tie/RefHash.pm + line 104 eval {...} called at C:/Perl64/lib/Tie/RefHash.pm line 104 require WWW/Mechanize.pm called at test.pl line 5 main::BEGIN() called at C:/Perl64/lib/Tie/RefHash.pm line 104 eval {...} called at C:/Perl64/lib/Tie/RefHash.pm line 104 BEGIN failed--compilation aborted at C:/Perl64/lib/Tie/RefHash.pm line + 104. at C:/Perl64/lib/Tie/RefHash.pm line 104. require Tie/RefHash.pm called at C:/Perl64/lib/WWW/Mechanize.p +m line 11 WWW::Mechanize::BEGIN() called at C:/Perl64/lib/Tie/RefHash.pm + line 104 eval {...} called at C:/Perl64/lib/Tie/RefHash.pm line 104 require WWW/Mechanize.pm called at test.pl line 5 main::BEGIN() called at C:/Perl64/lib/Tie/RefHash.pm line 104 eval {...} called at C:/Perl64/lib/Tie/RefHash.pm line 104 Compilation failed in require at C:/Perl64/lib/WWW/Mechanize.pm line 1 +1. at C:/Perl64/lib/WWW/Mechanize.pm line 11. WWW::Mechanize::BEGIN() called at C:/Perl64/lib/WWW/Mechanize. +pm line 11 eval {...} called at C:/Perl64/lib/WWW/Mechanize.pm line 11 require WWW/Mechanize.pm called at test.pl line 5 main::BEGIN() called at C:/Perl64/lib/WWW/Mechanize.pm line 11 eval {...} called at C:/Perl64/lib/WWW/Mechanize.pm line 11 BEGIN failed--compilation aborted at C:/Perl64/lib/WWW/Mechanize.pm li +ne 11. at C:/Perl64/lib/WWW/Mechanize.pm line 11. require WWW/Mechanize.pm called at test.pl line 5 main::BEGIN() called at C:/Perl64/lib/WWW/Mechanize.pm line 11 eval {...} called at C:/Perl64/lib/WWW/Mechanize.pm line 11 Compilation failed in require at test.pl line 5. at test.pl line 5. main::BEGIN() called at test.pl line 5 eval {...} called at test.pl line 5 BEGIN failed--compilation aborted at test.pl line 5. at test.pl line 5

In reply to Re: Bareword error in WWW::Mechanize by Old_Hat
in thread WWW::Mechanize “use constant xx” gets bareword error by Old_Hat

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.