Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

perl doesnt print to browser

Status
Not open for further replies.

richardko

Programmer
Jun 20, 2006
127
US
hi,
this is a simple script which works fine from CLI but when I access in browser(firefox) doesnt print anything to screen. this must be simple to fix..

#!/usr/bin/perl

print "Content-type: text/html\n\n";

open(CHECKBOOK,"/var/log/maillog");

while ($line = <CHECKBOOK>)
{
if($line=~/host name lookup failure/)
{
$line=~/to=<(.*)>,/;
print $1;
print "\n";
}
}
close(CHECKBOOK);

any idea?
 
try this:

Code:
open(CHECKBOOK,"/var/log/maillog") [b]or die "Can't open /var/log/mailog: $!"[/b];

- Kevin, perl coder unexceptional!
 
Thanks
it was permissions issue. I gave "others" the read option and it worked.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top