Turns out that when you use the LWP::Simple & CGI modules together in a Perl script, each has a conflicting head() function that throws that error. Who knew? Everyone who took the time to read the CAVEAT note at the end of the LWP::Simple docs, apparently:
Note that if you are using both LWP::Simple and the very popular CGI.pm module, you may be importing a
headfunction from each module, producing a warning like “Prototype mismatch: sub main::head ($) vs none”. Get around this problem by just not importing LWP::Simple’s
headfunction, like so:use LWP::Simple qw(!head); use CGI qw(:standard); # then only CGI.pm defines a head()
Then if you do need LWP::Simple’s
headfunction, you can just call it as
I need to use both function CGI:: head($url ) and LWP::Simple::head($url). Then how should call and what will be the import code (use LWP::Simple).