Philip M. Gollucci <[EMAIL PROTECTED]> wrote:
> Tyler MacDonald wrote:
> >Global symbol "$r" requires explicit package name at
> >/opt/weedns-4/skins/yi/perl5lib/yi/page/css.pm line 16.\nCompilation failed
> >in require at /opt/weedns-4/skins/yi/htdocs/css.pl line 6.\nBEGIN
> >failed--compilation aborted at /opt/weedns-4/skins/yi/htdocs/css.pl line
> >6.\n
> >
> >
> >Here's lines 14 - 20 of css.pm:
> >
> >14 - sub handler {
> >15 -    my($class, $r) = @_;
> >16 -    $r->content_type("text/html");
> >17 -    $r->print("<LINK REL=\"STYLESHEET\" TYPE=\"text/css\" 
> >HREF=\"/yi.css\" />\n");
> >18 -    $r->status(OK);
> >19 -    return OK;
> >20 - }
> Can you show lines 1-14 and the httpd.conf section for this handler ?

        css.pl used to contain all of the code and the error still happened
-- as part of troubleshooting I started working on moving away from
depending on ModPerl::Registry...

        Entire file attached, and the file that calls it is attached as
well. The handler is ModPerl::Registry. css.pl/.pm was just an example, this
happens intermittently on just about every registry script that runs. :-(
There's only one thing that I'm doing that's some might consider unusual:

        <Files "*.pl">
                Options                         +ExecCGI
                PerlResponseHandler     ModPerl::Registry
                SetHandler                      perl-script
                SetOutputFilter     INCLUDES
        </Files>

        That is, using the INCLUDES output filter to post-process the
perl output. That said, this worked beautifully in mod_perl 1.99, and that
happens on the C side away from perl, so it shouldn't make a difference,
should it?


                - Tyler

#!perl

use strict;
use warnings;
use Apache2::RequestUtil ();
use yi::page::css;

my $r = Apache2::RequestUtil->request;
yi::page::css->handler($r);
exit(0);
#!perl

package yi::page::css;

use strict;
use warnings;

use Apache2::RequestRec ();
use Apache2::RequestIO ();
use Apache2::Const qw(OK);

return 1;

sub handler {
    my($class, $r) = @_;
    $r->content_type("text/html");
    $r->print("<LINK REL=\"STYLESHEET\" TYPE=\"text/css\" HREF=\"/yi.css\" />\n");
    $r->status(OK);
    return OK;
}

Reply via email to