Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What are scalar data and scalar variables?

1053


What is lexical variable in perl?

871


What are scalars in perl?

891


Why do you use Perl?

916


How can you use Perl warnings and what is the importance to use them?

902


How and what are closures implemented in perl?

835


How do you find the length of an array?

902


Why to use perl scripting?

929


Is there any way to add two arrays together?

911


What does perl do in linux?

885


How do you you check the return code of a command in perl?

937


Explain string comparison operators in perl.

958


Which has highest precedence in between list and terms? Explain?

815


How can you define “my” variables scope in Perl and how it is different from “local” variable scope?

1044


Hi, I am a accountant. I am preparing a balance sheet but because of staff shortage and time pressures I cant complete it on time. There is lot of common data with last years which I need not retype and I can manage by editing last year’s balance sheet ? Is their any software on net where I can do this easily??

2093