Theres a handy little trick for situations like this.
Get rid of the content-type:text/html line, and put the following at the start of your script:
Code:
#!/usr/bin/perl
BEGIN
{
print "Content-type: text/html \n\n";
}
my @code = ( <DATA> );
my $code = join "\n",@code;
eval $code;
print "Error : ".$@ if ( $@ );
__DATA__
Your script follows as normal here
This should work on a lot of simple scripts that you write yourself.
The way it works is by telling perl that your script ( the stuff after __DATA__ ) isn't perl, but data, so when perl first runs, it'll make no effort to understand it. Then, this data section is turned into a string, and perl runs it using eval, which will hopefully catch the errors ( if $@ ), and print them out.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.