Following is a perl script. It is running on shell when I go perl followed by the filename and works perfectly. But when I try to open it from browser, it gives back a 500. The permissions are fine because if i make some syntax error, it gives me the expected error message on browser screen:
#!/usr/bin/perl
use strict;
use CGI;
use CGI::Carp "fatalsToBrowser";
use DBI;
use LWP;
my $cgi = new CGI;
my $url = "http://www.google.com";
my $browser = LWP::UserAgent->new;
my $content = $browser->get($url);
print $cgi->start_html(), $cgi->header();
my $doc= $content->content();
if(length($doc) > 100)
{
extractMeta($doc);
}
print $cgi->end_html(), "\n";
sub extractMeta()
{
print "Inside subroutine";
#Databse Information
}
Can someone tell me whats killing it in the browser??