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
“The methods defined in the parent class will always override the methods defined in the base class”. What does this statement means?
Explain subroutine?
What is lexical variable in perl?
What are numeric operators in perl?
What is subroutine in perl?
How do I replace every TAB character in a file with a comma?
what is CPAN?
For a situation in programming, how can you determine that Perl is a suitable?
What is perl unshift array function?
If you want to empty an array then how would you do that?
What are some of the key features of objects in perl?
Mention how many ways you can express string in Perl?
Explain cpan?
What interface used in PERL to connect to database? How do you connect to database in Perl?
What does perl do in linux?