in reply to Re^3: Help with error;
in thread Help with error;

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

Replies are listed 'Best First'.
Re^5: Help with error;
by Corion (Patriarch) on Sep 21, 2010 at 14:30 UTC
    Anyhow, It is very odd that if the -w or -a is in the shebang then there is no error in the browser.

    This usually means that you're uploading changed versions from Windows to Unix through FTP and have (no) line ending conversion. The trailing Windows newline throws the kernel off and it can't launch Perl. So always use #!.../perl -w at the top of your script.

    You talking in prose about what you did and making vague remarks as to what you might have put where in general does not help us (and by extension, you) debugging your problem. Show a self-contained concrete example that exhibits the problem and is shorter than 20 lines. This allows us to give you a concrete diagnosis and helps us to help you better.

    Also, please tell us which message you get from where - the browser, the error log, the access log or the console.