in reply to a classic : 'Premature end of script headers' problem

Here's one thing to help with getting debug info right away
#!/usr/bin/perl # consent.cgi BEGIN { use CGI::Carp 'fatalsToBrowser'; } use strict; use warnings; use CGI qw(:standard); use Fcntl ':flock'; # ...... # as a curiosity also.. my $iam = `whoami`; open(STDERR, '>>', '/home/myself/errlog') or die($!); warn("I am [$iam]");
Can you log into the machine via ssh?? Then..
bash # tail -f /home/myself/errlog

After that hold the shell window on one side, and run the script on the other to see the output real time

Replies are listed 'Best First'.
Re^2: a classic : 'Premature end of script headers' problem
by ikegami (Patriarch) on Sep 19, 2007 at 18:36 UTC
    use already executes at the same time as BEGIN. So while moving CGI::Carp higher is good, there's no need to use BEGIN.
    #!/usr/bin/perl # consent.cgi use CGI::Carp 'fatalsToBrowser'; use strict; use warnings; use CGI qw(:standard); use Fcntl ':flock'; ...