I am writing on a little script that checks on user input from an html-form.
The parameters are send to the script through STDIN. The perl code I am currently using:
@items = split(/&/,$teststring);
foreach $line (@items){
($dummy1,$dummy2) = split(/=/,$line);
$hash{$dummy1} = $dummy2;
}
This works fine as long as the user does not enter an ampersand,which works as a delimiter in this case, in one of the input fields.
Since in the html form a commentary field is included this might likely happen. So if the user writes something
like this: "blabla et & cetera" I will end up with wrong hash keys an parts of the input are lost.
How can I split the string correctly?
Thank You!
Your's
C-Keen