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

Hi All -

I have two perl scripts using CGI that are part of a larger application. Both have the following lines to begin the creation of a web page:
print $cgi->start_html(-head=>meta({-http_equiv => 'Content-Type', - +content => 'text/html'}), -title=>"pagetitle", -bgcolor=>"#dcdcdc", -al +ink=>"#4682B4", -vlink=>"#4682B4", -link=>"#4682B4");
The problem I am having is this: sometimes when I click one of the links to execute either of the two scripts, the page will display fine. Other times, I get an Internal Server Error, and the following line in my Apache error_log:
[error] Undefined subroutine &Apache::ROOT::perl::ms_support_2epl::met +a called at /var/www/htdocs/imap-bin/ms_support.pl line x.
where 'line x' corresponds to the 'print $cgi->start_html...' line above.

Sometimes script 1 works, but not script 2. Sometimes the reverse is true. Sometimes both work, and sometimes neither. I am pulling my hair out over this! Does anyone have any suggestions?

Thanks for your time!

Replies are listed 'Best First'.
Re: CGI: Server error on meta tag
by PodMaster (Abbot) on Dec 15, 2002 at 02:52 UTC
    So where do you define meta?

    I know it's exported optionally by CGI.pm, but I don't see you doing that anywhere. I suggest you do it

    use CGI qw[ meta ];
    Please read the CGI.pm documentation for further details.


    MJD says you can't just make shit up and expect the computer to know what you mean, retardo!
    ** The Third rule of perl club is a statement of fact: pod is sexy.

      Thanks, PodMaster. I don't see that requirement anywhere in the documentation for CGI.pm, but it seems to have done the trick. (I'm looking here - is there somewhere else that has more information?)

      Thanks again!
      InsolentFlunkey
        requirement?

        It's a big document, you must read it till your eyes bleed ;)

        Where did you get the idea to use meta instead of $query->meta()?

        It should have been from USING-THE-FUNCTION-ORIENTED-INTERFACE, which explains lots.


        MJD says you can't just make shit up and expect the computer to know what you mean, retardo!
        ** The Third rule of perl club is a statement of fact: pod is sexy.