Willman023 has asked for the wisdom of the Perl Monks concerning the following question:

Fellow monks,

I was taken by surprise this week by a question asked this week in one of our email groups at Lockheed Martin by a perl savvy developer, and I couldn't understand why he would rule out Perl(Question posted below). Being that he wanted a daemon process updating an html page, I immediately figured Perl to be the best choice, but to my surprise there were people suggesting Flash for it. Now I'll agree Flash is great for movies and music, but for web programming also...I dunno. I replied that I would use Perl if I were him, but I couldn't find code on this site that would do what he wants. Also, talking with other people in my group, they said that he wanted it to be dynamic such that it doesn't have to refresh the page...can Perl be used if he wants a page to scroll without the page being refreshed? Or does he need to use a refresh call in the META tags to rerun a script every 30 seconds or a while(1) loop?

Question:

Does anyone know of a way to make vertically scrolling text on a web page that would be updated periodically from a file on the web server? I've seen plenty of scrollers out there but most of them are pretty static. Ideally I would like the update from the text file to just start appending the new text at the bottom of the previous scrolling message. This would make it appear to be "real-time", but in actuality would probably be updated every 30-60 seconds. The purpose is for a web based syslog monitor.

bW

Trying to solve the worlds problems with Perl!

Replies are listed 'Best First'.
Re: Dynamic scroller
by talexb (Chancellor) on Nov 22, 2002 at 21:49 UTC

    I don't see any reason why a META refresh tag wouldn't work. I'd prefer that method rather than having a CGI 'push' data out to a browser -- better to have it requested *by* the browser.

    And the reason that you may not have seen a response to this particular question on this site is because this is more of an HTML/HTTP question than Perl related. IMHO. :)

    --t. alex
    but my friends call me T.
Re: Dynamic scroller
by BrowserUk (Patriarch) on Nov 22, 2002 at 22:48 UTC

    One thing that is useful with auto-refreshing and scrolling pages is to put the scrolling and/or auto refreshing part into an IFRAME tag. As well as allowing you to have some static stuff (controls and such) on screen that doesn't get scrolled, I've also found that when the content of the IFRAME gets refreshed, it tends (in some browsers anyway) to leave the scrolled section in the same place as it was before refreshing.

    I like this rather than have the whole page refresh and force me to drag the scroll bar so that I can continue reading what I was reading before the refresh occurred.

    I'm not sure if this is true in all browsers.


    Okay you lot, get your wings on the left, halos on the right. It's one size fits all, and "No!", you can't have a different color.
    Pick up your cloud down the end and "Yes" if you get allocated a grey one they are a bit damp under foot, but someone has to get them.
    Get used to the wings fast cos its an 8 hour day...unless the Govenor calls for a cyclone or hurricane, in which case 16 hour shifts are mandatory.
    Just be grateful that you arrived just as the tornado season finished. Them buggers are real work.

Re: Dynamic scroller
by valdez (Monsignor) on Nov 22, 2002 at 22:07 UTC

    I would not scroll the page, instead I would use Perl to reverse the output, putting new messages at the top of the page.

    Ciao, Valerio

Re: Dynamic scroller
by traveler (Parson) on Nov 22, 2002 at 22:09 UTC
    I have developed a tool for a client that effectively does this using META REFRESH. The page has buttons for the user to select how often he/she wants to see the refresh. Current values are 5 sec, 15 sec, 30 sec and never.

    I have a perl script that generates xml data; refreshing the page causes the parsing of the data and conversion to HTML. This allows for colorization of important entries.

    HTH, --traveler

    BTW, Thanks to XML::Simple, I threw the whole thing together in about 1.5 - 2 hours as a proof of concept. It ran for a year without changes.