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
Which functions in perl allows you to include a module file. State their differences.
What does the’$_’ symbol mean?
What is the peculiarity of returning values by subroutines in perl?
What does a die() function do in perl?
Explain join function in perl?
What is the use of "stderr()"?
What is the purpose of goto expr statement?
Explain subroutine in perl?
Which functions in perl allows you to include a module file.
Explain perl. When do you use perl for programming?
Explain goto label, goto name, and goto expr?
Write syntax to use grep function?
What is q (single q) operator in perl?
There are two types of eval statements i.e. Eval expr and eval block. Explain them.
What does read () command do?