I've gotten spoiled with shell access, I guess. I'm now working on a site I can only access by ftp and browser. The browser returns an error of:
The server encountered an internal error and was unable to complete yo +ur request. Error message: Premature end of script headers: <scriptname>
I've commented out nearly everything, yet this is still what I get. There is already a script running here using DBI, from which I snagged the connection parameters. This passes the perl -wc check on my local sandbox, but when I upload it I get nothing but the browser error reported above. I'm running out of ideas for how to debug this. Any clues would be greatly appreciated.

-- Hugh

UPDATE
Well, that's embarrasing folks. I'm used to scp preserving permissions. Apparently ftp applies a mask to the incoming so folks are more deliberate about how they pass around privileges in the file system. A simple chmod was all it took. I guess it really was about me operating in a new environment. Now I need to go monitor what's happening on my test dataset. Thanks for the feedback.

#!/usr/bin/perl -w use strict; use DBI; # use CGI::Carp qw(fatalsToBrowser); # use lib qw{/public_html/lib}; # use Date::Manip; my $preserve_date = '2006-10-30'; my %registrations; # my $dbh = DBI->connect('dbi:mysql:dbname','userID','secret',{RaiseEr +ror=>1}) or die "no \$dbh: $DBI::errstr"; # ### ALL THE MAIN() LOGIC HAS BEEN COMMENTED OUT! print <<EOF; <html> <head> <title>Masking Private Data</title> </head> <body> <h2>Masking Private Data</h2> This script is masking private data in the test data set with a depart +ure date before $preserve_date. Records related to later events are +being preserved.<p> </body> </html> EOF 1; sub parse_date { my ($date_str) = @_; my $date = ParseDate($date_str); $date = substr($date,0,4) . '-' . substr($date,4,2) . '-' . substr($ +date,6,2); return $date; }
if( $lal && $lol ) { $life++; }

In reply to Debugging without shell access? by hesco

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.