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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |