#!/usr/bin/perl
use strict;
use warnings;
use CGI; # Assumption
use CGI::Carp qw( fatalsToBrowser );
# Rest of the code
This will translate your Perl errors and send the output to the browser.
The "Premature script headers" can sometimes be someting that is easily missed and easier to fix.
Try the following if the above snipped doesn't help much:
print "Content-type: text-html\n\n";
This will provide the output with enough headers to be processed as an HTML document.
If the content-type is not the issue, I would certainly make sure you debug with the Carp snippet. You can, naturally take out the 'use' when you're finished debugging, however it will usually point you in the right direction of the problem.
Also, make sure the file permissions are satisfactory to execute on the server. You should be safe with chmod 755 <FILE> (-rwxr-xr-x) if not already set this way.
Good luck!
---hA||ta----
print map{$_.' '}grep{/\w+/}@{[reverse(qw{Perl Code})]} or die while ( 'trying' );
| [reply] [d/l] [select] |
Printing a content-type is a good idea, but it won't always work -- you'll want to turn output buffering off, just in case something throws an error before the print buffer gets flushed, and even then, it might not get to the print statement if something happens in a BEGIN block. (and well, 'use' counts as a BEGIN block.
Based on the error message, I doubt it's a permissions problem, but I would make sure that the file passes 'perl -wc filename' from the command line -- it'll let you know if there's something blatently wrong with it (like missing modules, which is a distinct probability when switching systems, even when the perl versions are the same)
Oh -- and for debugging, I love CGIwrap. It handles processing limits on my CGIs and keeping them from running as the webserver, and a quick change to the URL, and it'll spit debugging info back to you.
| [reply] |
| [reply] |
Usually SOAP::Lite require many modules. Can you execute via shell ?
If don't, try one code like code:
eval " use PM::Rio; ";
if ( $@ ) {
print "Required module PM::Rio unavailable...\n";
} else {
print "Loaded ;)\n";
}
More info on SOAP::Lite prerequisites...
| [reply] [d/l] |