in reply to Delayed Redirect using CGI.pm

I sincerely doubt CGI is printing windows charset headers. I suspect you are using IE, don't. IE reformats the HTML of a site and is thusly utterly useless for "debugging" a design. Try Amaya, Netscape, Mozilla, Opera, Lynx, or even telnet.

Undefined subroutine &main::meta called at - line 3, <STDIN> line 1.
It's -meta{} not meta().

--
perl -pew "s/\b;([mnst])/'$1/g"

Replies are listed 'Best First'.
Re: Re: Delayed Redirect using CGI.pm
by Kanji (Parson) on May 14, 2002 at 01:52 UTC
    It's -meta{} not meta().

    While -meta is the recommended way of handling the majority of meta tags, current versions of CGI.pm (2.752+, possibly earlier) don't advocate it's use for generating HTTP-EQUIVs, instead saying...

    To create an HTTP-EQUIV tag, use the -head argument as described below.

    ... and then under -head (reformatted for clarity) ...

    To create an HTTP-EQUIV tag, use something like this:

    print start_html( -head => meta( { -http_equiv => 'Content-Type', -content => 'text/html', } ), );

        --k.


    Update: Added CGI.pm version number.

    Update II: On second glance, the current recommended method (ab)uses a feature in CGI's that turns any unknown CGI methods into (X)HTML...

    $ perl -MCGI=foo -le 'print foo({-bar => "baz"})' <FOO BAR="baz">
      And yet meta() gives the error above (UPDATE: oic, it's an optional export (though I cannot find the subroutine). we were not told that symbols were being explicitly imported...). The CGI here (v2.56) states:
      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.co +m');
      No meta() anywhere. Refresh is a possible value of the HTTP-EQUIV meta tag.

      UPDATE: I see that the current version is 2.81, wahoo. Hrmm. Oh well. Seems to me it's be nicer to use the actual HTTP header than the meta tag anyways, given the option. But it looks like TIMTOWTDI

      --
      perl -pew "s/\b;([mnst])/'$1/g"

        Success - thanks belg4mit. Your header redirect works perfectly.