Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
NPH script stopped working correctlyby ultranerds (Hermit) |
on May 15, 2015 at 10:15 UTC ( [id://1126758]=perlquestion: print w/replies, xml ) | Need Help?? |
ultranerds has asked for the wisdom of the Perl Monks concerning the following question: Hi, I've got a bit of an annoying issue! Our script used to work just fine - where it would print out the pages content as it was outputted from the script (using nph headers). However, for the last couple of weeks it just prints out the plain text (not HTML). To test this out, I made 2 scripts: testing.cgi Both with the same code: #!/usr/bin/perl $| = 1; print "Content-Type: text/html\n \n"; print "FOO"; for (my $i = 0; $i <= 5; $i++) { print "$i ... "; sleep 2; } When I run the testing.cgi script (in the browser), I correctly see this (all be it after 10 seconds, due to the "sleep" commands); FOO0 ... 1 ... 2 ... 3 ... 4 ... 5 ... However, when I run nph-testing.cgi (again, in the browser), I get: Content-Type: text/html FOO0 ... 1 ... 2 ... 3 ... 4 ... 5 ... As you can see, its printing the header out - instead of telling the browser that: a) this needs to be a HTML page, and b) that it should be doing this via nph I'm a bit baffled as to what could suddenly be causing this to occur. At first, I thought my script was outputting some content BEFORE I had printed the correct header - but this test script proves that not the case. Anyone got any suggestions? I'm drawing a blank here (and the techs for the server are not too helpful, as they don't seem to know much about Perl) TIA Andy
Back to
Seekers of Perl Wisdom
|
|