Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
We don't bite newbies here... much
 
PerlMonks  

Re: Linux message log webifier

by wog (Curate)
on Aug 31, 2001 at 05:00 UTC ( [id://109299]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Linux message log webifier

... since you asked for comments .... Two key issues here:

  • Please use warnings and strict.
  • Always check the return value of system calls like open, so you don't get very odd things happening when/if they fail, e.g.:
    open (TEMPOUT,">$outfile") or die "opening $outfile: $!\n";

Less importantly:

  • You could improve much of your HTML outputing code with heredocs:
    print TEMPOUT <<"END"; <html><body> ... END
  • You may wish to look at the $. line-counting variable documented in perlvar as an alternative to your counter variable.
  • You output malformed HTML. Please close all tags,use DOCTYPE at the beginning of your document, and quote attribute names not containing only alphanumeric characters, etc.

Replies are listed 'Best First'.
Re: Re: Linux message log webifier
by hans_moleman (Beadle) on Aug 31, 2001 at 11:34 UTC

    thanks for your comments!

    it is appreciated...

    Actually, I found the script was difficult to debug because of file issues, so your point about evaluating system calls is especially well taken. ;)

Re: Re: Linux message log webifier
by hans_moleman (Beadle) on Aug 31, 2001 at 13:14 UTC

    You'll note I have implemented most of your suggestions. Sure looks a lot cleaner ouputing the HTML that way... Thanks again.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://109299]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.