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 interface used in PERL to connect to database? How do you connect to database in Perl?
How will you declare a variable in perl?
Write an example explaining the use of symbol tables.
What is perl? What is the basic command to print a string in perl?
What is hash?
What is perl I used for?
Explain the meaning of closure in perl.
Write a program that shows the distinction between child and parent process?
Explain substr function in perl?
Explain chomp?
How would you ensure the re-use and maximum readability of your perl code?
What are perl strings?
What does localtime() do in perl?
What are the features of perl language?
What is stdin in perl?