| | |
500 Internal Error, But script runs on shell!
Please support our Perl advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
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:
Can someone tell me whats killing it in the browser??
PERL Syntax (Toggle Plain Text)
#!/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??
Live free.... Die Hard!
![]() |
Other Threads in the Perl Forum
- Previous Thread: Using Special Variables
- Next Thread: Warning message: 'old-style' syntax
Views: 786 | Replies: 7
| Thread Tools | Search this Thread |
Tag cloud for Perl






