
runs okay in shell, not in browser
Hello!
I've been puzzling over this piece of code for some time now. It runs
perfectly when I execute it by typing in its name (or when I type "perl
userlog.cgi", but the script refuses to run if I call it via a web
browser-- it displays only a small part of the middle of the expected
output:
Here is the script:
----------------------
#!/bin/perl
# userlog.cgi
print "Content-type: text/html", "\n\n";
print "<HTML>", "\n\n";
print "<HEAD>", "\n\n";
print "<TITLE>", "Users logged in ","</TITLE>","\n\n";
print "</HEAD>","\n\n";
print "<BODY>\n";
%ucnt = ();
for (`who`) {
s/\s.*\n//;
$ucnt{$_}++;
Quote:
}
<BR> ";
Quote:
}
print "\n", "</BODY>","\n\n";
print "</HTML>","\n\n";
---------------
end of script
And this is what it displays:
Users logged in: someuser someuser
|- this has the correct email address link
Any idea why it doesnt run thru a browser?
(file permissions are 755)
Sent via Deja.com http://www.*-*-*.com/
Share what you know. Learn what you don't.