perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pradeep Hodigere <p_hodig...@yahoo.com>
Subject Re: newbie
Date Fri, 24 Mar 2000 01:26:33 GMT

perl -MApache::File -e 'print "ok\n";' prints ok ..
The code goes like this...

It fails at the use Apache::File line with the error i
had mentioned.

package Apache::Footer;
# file: Apache/Footer.pm

use strict;
use lib qw(/usr/local/apache/lib/perl/Apache );
use Apache::Constants qw(:common);
use Apache::File ();

sub handler

        my $r = shift;
        return DECLINED unless $r->content_type eq
'text/html';

        my $file = $r->filename;

        unless(-e $r->finfo){
                $r->log_error("File does't exist\n");
                return NOT_FOUND;
        }

        my $modtime = localtime((stat _)[9]);

        my $fh;
        unless($fh = Apache::File->new($file)){
                $r->log_error("Couldn't open file for
reading.\n");
                return SERVER_ERROR;
        }

        my $footer = <<END;

<hr>
&copy; 2000 <a href=">http://localhost">Employee 
&amp; Associates</a><br>
<em>Last Modified: $modtime</em>
END

        $r->send_http_header;

        while(<$fh>){
                s!(</BODY>)!$footer$1!oi;
        }continue{
                $r->print($_);
        }

        return OK;



--- Cliff Rayman <cliff@genwax.com> wrote:
> What happens if you type at the command line?
> 
> perl -MApache::File -e 1
> 
> If you receive no output - then Apache::File can
> be found by perl.  If this is the case - we will
> need to see more info on how and where it is
> being used to figure out what is wrong with your
> config.
> 
> cliff rayman
> genwax.com
> 
> Pradeep Hodigere wrote:
> 
> > Hi,
> >   My @INC has the following path listed and
> > Apache::File.pm is under
> >    /usr/lib/perl5/site_perl/5.005/i386-linux
> >
> > 0 /usr/lib/perl5/5.00503/i386-linux
> > 1 /usr/lib/perl5/5.00503
> > 2 /usr/lib/perl5/site_perl/5.005/i386-linux
> > 3 /usr/lib/perl5/site_perl/5.005
> > 4 .
> >
> >  I have tried moving File.pm into the directory
> and
> > doing a "use File" with the  same error result.
> >
> > Pradeep.
> >
> > --- "G.W. Haywood" <ged@jubileegroup.co.uk> wrote:
> > > Hi there,
> > >
> > > On Thu, 23 Mar 2000, Pradeep Hodigere wrote:
> > >
> > > > Yep,
> > > >   @INC has the path where Apace::File
> resides.I
> > > tried
> > > > even moving the module across and explicitly
> > > "use"ing
> > > > it but with no success..
> > >
> > > I'm not 100 percent sure I understand you.
> > >
> > > What is the *full* path for your File.pm?
> > >
> > > 73,
> > > Ged.
> > >
> > >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Talk to your friends online with Yahoo! Messenger.
> > http://im.yahoo.com
> 
> 

__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

Mime
View raw message