Yes, I just made a duplicate: index2a.cgi

then I changed the shebang to this:

#!/usr/bin/perl -a
to
#!/usr/bin/perl
so just removed the -a now I get an 500 error on the webscript but not from shell, and the error log has this:
Premature end of script headers
however, it does not have that if I put either -a or -w after the shebang line.

so I do not know why that would happen. I never print anything without first printing: print header(-charset=>"UTF-8");

except if I am printing to a file:
open(FILE,">/path/to/file") or die "could not open file: $!"; print FILE qq~Hello this is just a test to see if it works.~; close(FILE);
I do that for debugging sometimes.

The config file I use is a file called: vars.conf and it just has a bunch of subroutines in it that are standard and a bunch of code that is standard.

I call it by using require.

That file was over 7k lines long so I broke it down into two:
vars.conf and varsEsubs.conf which vars.conf calls the other using require. Only did that because when I first did that file I was on a slow internet so while I uploaded the file it took a while and since we were always live I was always worried someone on the site would get a software error from the file not being available while it was being over-wrote. So I broke it down into smaller files.

Anyhow, It is very odd that if the -w or -a is in the shebang then there is no error in the browser.

I guess I'll duplicate everything then start playing with it to see if I can find the problem.

Thanks for any more help you can be and for the help you've already been.

Mack

In reply to Re^4: Help with error; by Anonymous Monk
in thread Help with error; by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.