B
bbxrider
i' ve found this code for parsing form input
foreach (split(/[&;]/, $buffer)) {
s/\+/ /g ;
($name, $value)= split('=', $_, 2) ;
$name=~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/ge ;
$value=~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/ge ;
..........
i know it works but the data is ascii characters to begin with and don't
understand what is the need for the substitution after converting all the
+'s to spaces??
i know am cycling thru the input field names and their values character by
character for searching for only digits and upper+lower case alphabet
to substitute but
don't understand significance of the % sign,
not really sure what the {2} grouping is doing
and basically it seems to be saying look for ascii digits and alphabet and
convert the hex value of those characters to the same value as starting
with, in other words, convert the original value back to the original
value????????
is type of conversion only necessary due to properties of form input data on
the web????
foreach (split(/[&;]/, $buffer)) {
s/\+/ /g ;
($name, $value)= split('=', $_, 2) ;
$name=~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/ge ;
$value=~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/ge ;
..........
i know it works but the data is ascii characters to begin with and don't
understand what is the need for the substitution after converting all the
+'s to spaces??
i know am cycling thru the input field names and their values character by
character for searching for only digits and upper+lower case alphabet
to substitute but
don't understand significance of the % sign,
not really sure what the {2} grouping is doing
and basically it seems to be saying look for ascii digits and alphabet and
convert the hex value of those characters to the same value as starting
with, in other words, convert the original value back to the original
value????????
is type of conversion only necessary due to properties of form input data on
the web????