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">Is the world round?
<input type=radio name="ans" value="0">Yes
<input type=radio name="ans" value="1">No <br>
Using perl I want to be able to do the following....
1. From all the html I only want to read the <input> 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 => 'Submit' will select the submit button below the question.
my $req = POST $theURL,
Content_Type => 'form-data',
Cookie => $COOKIE,
Content => [
$NAME => '$VALUE',
ANS1 => 'VAL1',
ANS1 => 'VAL2',
submit => 'Submit',
];
Does anybody know how I can do this in perl???
As much help as possible is required and appreciated.
Regards,
JohnO
it looks like this...
<input type=hidden name="Question" value="1">Is the world round?
<input type=radio name="ans" value="0">Yes
<input type=radio name="ans" value="1">No <br>
Using perl I want to be able to do the following....
1. From all the html I only want to read the <input> 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 => 'Submit' will select the submit button below the question.
my $req = POST $theURL,
Content_Type => 'form-data',
Cookie => $COOKIE,
Content => [
$NAME => '$VALUE',
ANS1 => 'VAL1',
ANS1 => 'VAL2',
submit => 'Submit',
];
Does anybody know how I can do this in perl???
As much help as possible is required and appreciated.
Regards,
JohnO