in reply to Bareword "HTTP::Status::RC_PERMANENT_REDIRECT" not allowed while "strict subs" for https request

OIDCAuth.pm will not be available in CPAN.This is own perl script to h +andle the http authentication.I will share some of the perl modules l +oading from this script. package CastIron::OIDCAuth; use strict; use warnings; use lib '/usr/share/perl5'; use URI; use SOAP::Lite; use Apache2::Access (); use Apache2::RequestUtil (); use CastIron::DBIWrap; use Digest::SHA1 qw(sha1_base64); use Cache::Memcached (); use Apache2::Const -compile => qw(OK DECLINED HTTP_UNAUTHORIZED); use LWP::UserAgent; - This is the line it is throwing exception for +us We have upgraded to perl 5.28.3 and after ugrading we are seeing the a +bove exception.Our Previous version of Perl is 5.12.3 there the we do +not see any issues and http request works fine. I have list of perlmodules installs but those are very huge and could +not find how to attach.
  • Comment on Re: Bareword "HTTP::Status::RC_PERMANENT_REDIRECT" not allowed while "strict subs" for https request
  • Download Code

Replies are listed 'Best First'.
Re^2: Bareword "HTTP::Status::RC_PERMANENT_REDIRECT" not allowed while "strict subs" for https request
by Corion (Patriarch) on May 06, 2021 at 13:58 UTC

    If you are running your script in a persistent environment like a mod_perl script, you might want to explicitly load HTTP::Status to make sure all the subroutines are explicitly defined:

    use HTTP::Status;

    In the long run, LWP::UserAgent should explicitly have use HTTP::Status; in its code as bliako commented, because it uses elements from that module.

    Update: The change has found its way into LWP::UserAgent and will be in some release.