I'm a newbie to this site and I wasn't sure whether to post this in this category or debuggin. I'm running Perl 5.6 on a Linux box running Apache. So I created this test script:
#!/usr/bin/perl
use CGI;
require "../common.sub";
use CGI::Carp qw(fatalsToBrowser);
print "Content-type: text/html\n\n";
print "Hello World";
and it wouldn't work on the web. I checked the server error logs and it said something about premature end of script. However when I ran it from the command line, it worked just fine. I searched the Perl forum cuz I knew something like this was probably common. I found out that if I put the "-w" option with the shebang line, it works fine on the web. So I have two questions. Why is that? And what do I need to do so that I don't have to use -w? You see I'm moving my site from a Win NT computer to a Linux cluster. I never had to use the -w on the Windows computer, but now I do. I thought Perl on Windows is the same as Perl on Linux. I don't want to have to go back through all my scripts and add in -w just so it would work. So how can I make it work without "-w"? I've asked this question and two other forums and people still haven't been able to figure out why this happens. Thanks for your help.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|