i'm not @ familiar perl, have understanding of html. i'm trying configure code online program processes text inputted user calculate , output few important numbers in order same large number of files containing text in local directory. problem lies in lack of understanding how or why code site splitting inputted text looking & , =, inputted text never contains these characters, , neither files. here's of code online program:
if ($env{'request_method'} ne "post") { &error('error','use standard input method=post'); } read(stdin, $buffer, $env{'content_length'}); if ($buffer eq '') { &error('error','can not execute directly','check usage'); } $ref = $env{'http_referer'}; @pairs = split(/&/,$buffer); foreach $pair (@pairs) { ($name,$value) = split(/=/,$pair); if ($name eq "atoms") { $atoms = $value; }
it uses these "pairs" appropriately calculate required numbers. input user textarea named "atoms", , form action cgi script:
<form method=post action="/path/to/the/cgi/file.cgi"> <textarea name="atoms" rows=20 cols=80></textarea> </form>
i've left out less important details of both html , perl codes. far i've been able content files in given directory in text format, when input script uses text textarea calculate values (in place of variable $buffer), doesn't work, suspect due split codes, cannot find & , = symbols. how code these symbols online script, , how can implement use local files? let me know if additional information needed, , in advance!
the encoding scheme forms use (by default) post data on http consists of key=value
pairs (hence =
) separated &
characters.
the latter doesn't matter form since has 1 control in it.
this described pretty succinctly in the html 4 specification , in more detail in the html 5 specification.
if aren't dealing data form, should remove form decoding code.
Comments
Post a Comment