Hi,
I am trying to learn cgi scripts and this tutorial i got from a site.How do i test it alone without html interaction?
can i pass the variable on command line,if yes how can i do.
I complied the code and it looks ok.i need to test to see if it is sending me a mail without the variable being passed from the html.
#!/usr/local/bin/perl
read(STDIN,$temp,$ENV{'CONTENT_LENGTH'});
@pairs=split(/&/,$temp);
foreach $item(@pairs)
{
($key,$content)=split(/=/,$item,2);
$content=~tr/+/ /;
$content=~s/%(..)/pack("c",hex($1))/ge;
$fields{$key}=$content;
}
print "Content-type: text/html\n\n";
print "<HTML>\n";
print "<BODY BGCOLOR=#FFFFFF>\n";
print "<CENTER>\n";
print "YOUR REQUEST HAS BEEN PROCESSED!<BR>\n";
print "</CENTER>\n";
print "</BODY></HTML>";
Thanks.
I am trying to learn cgi scripts and this tutorial i got from a site.How do i test it alone without html interaction?
can i pass the variable on command line,if yes how can i do.
I complied the code and it looks ok.i need to test to see if it is sending me a mail without the variable being passed from the html.
#!/usr/local/bin/perl
read(STDIN,$temp,$ENV{'CONTENT_LENGTH'});
@pairs=split(/&/,$temp);
foreach $item(@pairs)
{
($key,$content)=split(/=/,$item,2);
$content=~tr/+/ /;
$content=~s/%(..)/pack("c",hex($1))/ge;
$fields{$key}=$content;
}
print "Content-type: text/html\n\n";
print "<HTML>\n";
print "<BODY BGCOLOR=#FFFFFF>\n";
print "<CENTER>\n";
print "YOUR REQUEST HAS BEEN PROCESSED!<BR>\n";
print "</CENTER>\n";
print "</BODY></HTML>";
Thanks.