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
Write an example explaining the use of symbol tables.
What is the peculiarity of returning values by subroutines in perl?
Explain split function in perl?
How can the user execute a long command repeatedly without typing it again and again?
What exactly is grooving and shortening of the array?
How can I display all array element in which each element will display on next line in perl ?
What is the difference between die and exit in perl?
How do I read command-line arguments with Perl?
How to deleting an existing file in perl programming?
Explain perl.
What are the advantages of perl programming?
What is 'rollback' command in perl?
Write syntax to use grep function?
What is the importance of perl warnings?
What is Perl?