My eyes have glazed over and I still can't seem to get this simple multi-page nonparsed header script to work. If anyone could take a look at it, I'd appreciate it.
# NPH scripts requires that all scripts begin with the characters nph-
$| = 1;
print <<EOF ;
$ENV{'SERVER_PROTOCOL'} 200 OK
Server: $ENV{'SERVER_SOFTWARE'}
Content-type: multipart/x-mixed-replace; boundary=End
EOF
for ($loop = 0; $loop < 4; $loop++) {
print "--End\n";
print "Content-type: text/plain\n\n";
print "time=".time."\n";
if ($loop==3) {
print "--End--\n";
}
sleep (2);
}
exit (0);
Here's what it's returning...
--End
Content-type: text/plain
time=1021881040
--End
Content-type: text/plain
time=1021881042
--End
Content-type: text/plain
time=1021881044
--End--
Code:
#!/usr/local/bin/perl # NPH scripts requires that all scripts begin with the characters nph-
$| = 1;
print <<EOF ;
$ENV{'SERVER_PROTOCOL'} 200 OK
Server: $ENV{'SERVER_SOFTWARE'}
Content-type: multipart/x-mixed-replace; boundary=End
EOF
for ($loop = 0; $loop < 4; $loop++) {
print "--End\n";
print "Content-type: text/plain\n\n";
print "time=".time."\n";
if ($loop==3) {
print "--End--\n";
}
sleep (2);
}
exit (0);
Here's what it's returning...
Code:
time=1021881038 --End
Content-type: text/plain
time=1021881040
--End
Content-type: text/plain
time=1021881042
--End
Content-type: text/plain
time=1021881044
--End--