Re: Problem using use CGI and LWP modules together
- From: Jim Gibson <jgibson@xxxxxxxxxxxxxxxxx>
- Date: Thu, 11 Oct 2007 09:30:19 -0700
In article <e41tlrKm1jDHFAfU@xxxxxxxxxxxxxxxxxxx>, Nick Wedd
<nick@xxxxxxxxxxxxx> 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
My guess is that the LWP and CGI modules are incompatible somehow. Am I
right? Or am I invoking them wrong? Is there a recommended solution?
It does look like a name clash. I am able to reproduce this same error
on my system (perl 5.8.8).
You can use the OO features of CGI and avoid importing subroutines from
the module into your main:: namespace, provided you are comfortable
with the OO method of programming for CGI:
use CGI;
use LWP::Simple;
You will then have to define a CGI object and use method calls instead
of simple function calls.
Note that the following also demonstrates the error:
use CGI qw(head);
use LWP::Simple;
which really does indicate a 'head' clash.
--
Jim Gibson
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
.
- References:
- Problem using use CGI and LWP modules together
- From: Nick Wedd
- Problem using use CGI and LWP modules together
- Prev by Date: Re: Problem using use CGI and LWP modules together
- Next by Date: Re: Problem using use CGI and LWP modules together
- Previous by thread: Re: Problem using use CGI and LWP modules together
- Index(es):
Relevant Pages
|
|