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

I'm trying to set the Refresh: header with CGI.pm, but I seem to be missing something. I thought that the value was the time in seconds that you can view the page before refreshing:
print $q->header( -type => 'text/html', -expires => '-1d', -pragma => 'no-cache', -refresh => '100' ), $q->start_html( -title => 'Some Company's Bond Ticker', -bgcolor => '#00092A', -background => '../images/i-4-bg.gif', -onLoad => 'initSymbols()', -script => $script, -style => { -code => $css } );
It's taking abysmally long to refresh, however. I tried setting the time to '30' and it took several minutes (I stopped timing after two minutes and noticed it refreshing later). Shouldn't this generate the same result as <meta http-equiv="Refresh" content="100">?

The headers it generates look like this:

Expires: Thu, 05 Oct 2000 23:10:04 GMT Date: Fri, 06 Oct 2000 23:10:04 GMT Pragma: no-cache Refresh: 100 Content-Type: text/html
I'm using IE 5.5, and the page in question is bond ticker in a frame running along the bottom of a Page. The page also has a bit of JavaScript, so I wonder if that has any effect -- perhaps throwing the browser's timing off? Also, if this is not a reliable method of refreshing the Web page, can anyone make any suggestions?

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just go the the link and check out our stats.

Replies are listed 'Best First'.
RE: Refreshing a Web page via Perl
by extremely (Priest) on Oct 07, 2000 at 03:56 UTC

    I always do a <meta HTTP-EQUIV="Refresh" content="240"> so I know not of this "Refresh:" http header...

    Luckily Lincoln knows... =)

    There is no support for the HTTP-EQUIV type of <META> tag.
    This is because you can modify the HTTP header directly
    with the header() method.  For example, if you want to
    send the Refresh: header, do it in the header() method:
    
        print $q->header(-Refresh=>'10; URL=http://www.capricorn.com');

    --
    $you = new YOU;
    honk() if $you->love(perl)

Re: Refreshing a Web page via Perl
by isotope (Deacon) on Oct 07, 2000 at 03:59 UTC