Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Just simply
$req = HTTP::Request->new( POST, $url, $header);
gives error
Bareword "POST" not allowed while "strict subs" in use
under "use strict".what should I do ?

Replies are listed 'Best First'.
Re: LWP and POST bareword
by choroba (Cardinal) on Nov 03, 2023 at 14:18 UTC
    Either quote the method name:
    $req = HTTP::Request->new('POST', $url, $header);

    or let the fat comma do it for you:

    $req = HTTP::Request->new(POST => $url, $header);

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]