Tuesday 27 July 2010

Using perl (CGI.pm) to generate a meta refresh tag with start_html

Perl version: 5.8.4
Operating System: Solaris 10 (should be irrelevant)
Problem: It's irritatingly difficult to get perl to generate a refresh tag...


This should have been simple, but wasn't.  Sounds like a good topic for a quick blog post.


How to generate <meta http-equiv="refresh" content="5" /> in your header tag with Perl.pm:
print start_html(
      -head=>meta({-http_equiv => 'refresh',
        -content => '5' }),
          );


Easy.  If you found this with two minutes googling, feel the warm, satisfying glow of knowing that it took me about two hours to figure that one out.

1 comment:

Anonymous said...

Good posting - as you kind of imply, two hours of Googling wouldn't be needed if there was a complete description given for the CGI module.