I have created a CGI-based page,after entering all the
values in to the fields, How to get the output on the web
browser using Perl
Answer Posted / vipul dalwala
print "content-type: text/html\n\n";.
if ($ENV{’REQUEST_METHOD’} eq ’POST’) {
read(STDIN, $buffer, $ENV{’CONTENT_LENGTH’});
}
else {
$buffer = $ENV{’QUERY_STRING’};
}
@keyvaluepairs = split(/&/, $buffer);
foreach $pair (@keyvaluepairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex
($1))/eg;
print $name . "=". $value ."<br>";
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are scalar data and scalar variables?
What is lexical variable in perl?
What are scalars in perl?
Why do you use Perl?
How can you use Perl warnings and what is the importance to use them?
How and what are closures implemented in perl?
How do you find the length of an array?
Why to use perl scripting?
Is there any way to add two arrays together?
What does perl do in linux?
How do you you check the return code of a command in perl?
Explain string comparison operators in perl.
Which has highest precedence in between list and terms? Explain?
How can you define “my” variables scope in Perl and how it is different from “local” variable scope?
Hi, I am a accountant. I am preparing a balance sheet but because of staff shortage and time pressures I cant complete it on time. There is lot of common data with last years which I need not retype and I can manage by editing last year’s balance sheet ? Is their any software on net where I can do this easily??