The absence of use HTTP::Status causes this error:

use strict; use warnings; #use HTTP::Status; my $x = HTTP::Status::RC_PERMANENT_REDIRECT;

This is because these "constants" are injected dynamically (via eval) into the module as part of initialisation code in HTTP::Status, see:

# https://metacpan.org/release/HTTP-Message/source/lib/HTTP/Status.pm # v 6.29 my $mnemonicCode = ''; my ($code, $message); while (($code, $message) = each %StatusCode) { # create mnemonic subroutines $message =~ s/I'm/I am/; $message =~ tr/a-z \-/A-Z__/; $mnemonicCode .= "sub HTTP_$message () { $code }\n"; $mnemonicCode .= "*RC_$message = \\&HTTP_$message;\n"; # legacy $mnemonicCode .= "push(\@EXPORT_OK, 'HTTP_$message');\n"; $mnemonicCode .= "push(\@EXPORT, 'RC_$message');\n"; } eval $mnemonicCode; # only one eval for speed die if $@;

So, a use HTTP::Status is needed. Furthermore, it seems that mnemonics prepended with RC_ are legacy. I assume the proper way to refer to the codes by message/mnemonic is via HTTP_PERMANENT_REDIRECT() (and not by RC_PERMANENT_REDIRECT)

LWP::UserAgent loads HTTP::Status indirectly via use LWP::Protocol;. Has your perl upgrade also included all installed modules?

bw, bliako


In reply to Re: Bareword "HTTP::Status::RC_PERMANENT_REDIRECT" not allowed while "strict subs" for https request by bliako
in thread Bareword "HTTP::Status::RC_PERMANENT_REDIRECT" not allowed while "strict subs" for https request by mohan.siripi

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.