Re: Problem using use CGI and LWP modules together



In message <5n6vptFgj9hcU1@xxxxxxxxxxxxxxxxxx>, Gunnar Hjalmarsson <noreply@xxxxxxxxx> writes
Nick Wedd wrote:
I am trying to develop a script to run on a web server. It uses the
modules
GD to do stuff with images
CGI to get the parameters from the URI
LWP to fetch stuff from the web
If my program begins
#!/usr/local/bin/perl
use strict;
use GD;
use GD::Text;
use CGI qw(:standard);
use LWP::Simple;
I get the error message
Prototype mismatch: sub main::head: none vs ($) at s4pngu.pl line 6
and if I change the order of the last two lines quoted above,
#!/usr/local/bin/perl
use strict;
use GD;
use GD::Text;
use LWP::Simple;
use CGI qw(:standard);
I get the error message
Prototype mismatch: sub main::head ($) vs none at
/usr/local/lib/perl5/5.8.8/CGI.pm line 305.
Removing the GD lines does not change this.
My guess is that the LWP and CGI modules are incompatible somehow. Am I
right?

Well, there seems to be a conflicting symbol 'head' that is imported by both LWP::Simple and CGI. Since you are using CGI only to get the CGI parameters, one way to solve the problem is to exchange

use CGI qw(:standard);

for

use CGI qw(:cgi);


Many thanks - that works.

Nick
--
Nick Wedd nick@xxxxxxxxxxxxx
.



Relevant Pages