Contributed by silent11
on Jul 17, 2002 at 18:20 UTC
Q&A
> subroutines
Description: I get a 'prototype mismatch error' when I try to load both LWP::Simple and CGI ':standard' into the same script. How can I get around this?
I'm using
perl v5.6.1
LWP v5.51
CGI v2.752
Thanks in advance -
-Silent11 Answer: prototyle mismatch error using LWP::Simple and CGI. contributed by japhy Both CGI and LWP::Simple export a 'head' function. If you aren't using LWP::Simple's head() function, only import what you want:
use LWP::Simple 'get';
Otherwise:
use CGI ':standard';
use LWP::Simple ();
...
print LWP::Simple::head(...);
| Answer: prototyle mismatch error using LWP::Simple and CGI. contributed by rjimlad Yes, the full error message is more-or-less self-explanatory. Personally, I'd just use CGI in OO mode, eg:
use CGI;
use LWP::Simple;
my $cgi=new CGI;
# LWP's head()
print head();
# CGI's head
print $cgi->head();
...and of course you can use 'require CGI' instead of 'use CGI', which could have potential benefits. |
Please (register and) log in if you wish to add an answer
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Outside of code tags, you may need to use entities for some characters:
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
|
|