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

Answers were Sorted based on User's Feedback



I have created a CGI-based page,after entering all the values in to the fields, How to get the out..

Answer / guest

In the form Action you have to specify the (perl) program,
you want to execute on submitting this form.

Is This Answer Correct ?    2 Yes 0 No

I have created a CGI-based page,after entering all the values in to the fields, How to get the out..

Answer / suvvari

In the HTML form, you have to mention the perl script name.
Ex: <form action="test.pl" method="POST">. Then in the
test.pl, you have to mention the content-type as
print "content-type: text/html\n\n";. And read the form
values and print them.

Is This Answer Correct ?    1 Yes 0 No

I have created a CGI-based page,after entering all the values in to the fields, How to get the out..

Answer / raghav

Including the First two answers also go thru CGI.pm module.
or else you can also use the cgi-lib.pl.
Go through the docs of the modules.

Is This Answer Correct ?    0 Yes 0 No

I have created a CGI-based page,after entering all the values in to the fields, How to get the out..

Answer / 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

More CGI Perl Interview Questions

Mention the difference between die and exit in Perl?

0 Answers  


How would you ensure the re-use and maximum readability of your perl code?

0 Answers  


How to renaming a file in perl programming?

0 Answers  


What are the reasons that cookie server can’t handle multiple connections?

0 Answers  


Explain ivalue?

0 Answers  






Which has the highest precedence, List or Terms? Explain?

0 Answers  


What are the characteristics of a project that is well suited to Perl?

1 Answers  


Why aren't Perl's patterns regular expressions?

0 Answers  


What are perl variables?

0 Answers  


“The methods defined in the parent class will always override the methods defined in the base class”. What does this statement means?

0 Answers  


Write a simple regular expression to match an IP address, e-mail address, city-state-zipcode combination.

15 Answers  


What is the main function of cookie server?

0 Answers  


Categories