Click to See Complete Forum and Search --> : Help - perl is driving me nutts


johnorwell
February 15th, 2000, 11:40 AM
I have a html form that is boolean type question. (i.e. yes or no answer)

it looks like this...

<input type=hidden name="Question" value="1"&gt;Is the world round?
<input type=radio name="ans" value="0"&gt;Yes
<input type=radio name="ans" value="1"&gt;No <br&gt;

Using perl I want to be able to do the following....

1. From all the html I only want to read the <input&gt; tags so I want to keep on reading the html content of the page until I've read all '<input'
2. If I find '<input type' and type = hidden I want to copy the value of name to $NAME and copy its value to $VALUE.
3. if I find '<input type' and type = radio I want to copy the value of name to $ANS1 and copy it value to $VAL1
3. if I find '<input type' again and type = radio I want to copy the value of name to $ANS1 and copy it value to $VAL2

I then want to write these values out as in below.

The submit =&gt; 'Submit' will select the submit button below the question.


my $req = POST $theURL,
Content_Type =&gt; 'form-data',
Cookie =&gt; $COOKIE,
Content =&gt; [

$NAME =&gt; '$VALUE',
ANS1 =&gt; 'VAL1',
ANS1 =&gt; 'VAL2',

submit =&gt; 'Submit',
];


Does anybody know how I can do this in perl???

As much help as possible is required and appreciated.

Regards,

JohnO