#!"C:\xampp\perl\bin\perl.exe"
##
## printenv -- demo CGI program which just prints its environment
##
print "Content-type: text/plain; charset=iso-8859-1\n\n";
print "sasi";
=cut
use mechanize;
my $ie = Mechanize->new( visible =>0 );
$ie->get('http://www.yahoo.com');
$content=$ie->content;
print $content;
print "Content-type: text/plain; charset=iso-8859-1\n\n";
print $request = $ENV{'QUERY_STRING'};
if ($ENV{'REQUEST_METHOD'} eq "GET") {
$request = $ENV{'QUERY_STRING'};
} elsif ($ENV{'REQUEST_METHOD'} eq "POST") {
read(STDIN, $request,$ENV{'CONTENT_LENGTH'})
|| die "Could not get query\n";
}
foreach $var (sort(keys(%ENV))) {
$val = $ENV{$var};
$val =~ s|\n|\\n|g;
$val =~ s|"|\\"|g;
print "${var}=\"${val}\"\n";
}
=end
Friday, February 22, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment