Re: SOS! Need Help with this small script!
Bill Mills-Curran (bcurran@clariion.com)
Tue, 7 Dec 1999 08:22:48 -0500 (EST)
On Tue, 7 Dec 1999, Keith H. wrote:
> Date: Tue, 07 Dec 1999 08:14:31 -0500
> From: Keith H. <keithhasson@noland.com>
> To: libwww@perl.org
> Subject: SOS! Need Help with this small script!
>
> Hi,
>
> I hate bothering you guys, but I really need an answer to this... I'm
>
> trying to read another webpage that requires values (i.e:
> www.someplace.com?A=1&B=1)
> I'm trying to variablize the parameters that follow the .com. but the
> $QUE part doesn't work. If I take out the variable $QUE in the
> $URL->query_form($QUE); line, and replace it with the quoted string, it
> works... How do I pass the quoted string properly to the query_form
> routine?
>
> TIA!!! Keith
>
> Here is a lookalike of my code(minus alot of junk):
>
> #! /usr/bin/perl
> use LWP::Simple;
> use URI::URL;
> ##############################################################
> print "Content-type: text/html\n\n";
> print "<HTML><HEAD></HEAD><BODY>";
> $URL=url('http://www.someplace.com/someform.html');
> $QUE="X =>1, U_SCR =>3";
> $URL->query_form($QUE); #If this reads $URL->query_form(X =>1,
> U_SCR=>3); it works...
There's an essential difference between a string argument, and the
argument list to a method/subroutine. You need to turn "$QUE" into an
array:
@QUE = ('X', 1, 'U_SCR', 3);
$URL->query_form(@QUE);
> $doc = get($URL);
> print "$doc";
> print "</BODY></HTML>";
>
Bill