perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Piesk <a.pi...@gmx.net>
Subject Re: problem with cache ?
Date Sun, 05 Mar 2000 20:41:17 GMT
On Sun,  5 Mar 2000 14:10:20 -0600, you wrote:

>a.piesk@gmx.net (Andreas Piesk) wrote:
>>i use a site-wide includefile. let's suppose it's name is site.pl.
>>the contents are
>>
>>sub commonheader{ print... };
>>sub commonfooter{ print ... };
>>sub frameheader{ print ... };
>>sub framefooter{ print ... };
>>1;
>...
>>content of navbar.pl
>>
>>use strict;
>>require "site.pl";
>>commonheader( "Navbar");
>># some blabla
>>commonfooter();
>>
>>default.pl creates a frameset with navbar.pl as a member. therefor
>>default.pl will be executed first and then navbar.pl. so should it be.
>>but all i get is a "server made a booboo".
>>
>>here's the error message:
>>
>>[Sun Mar  5 20:17:14 2000] [error] Undefined subroutine
>>&Apache::ROOT::testsite_2eperl::default_2epl::commonheader called at
>>/var/httpd/html/testsite/navbar.pl line 7.
>
>Instead of using a site.pl file and 'require' (old school), rename it Site.pm
>and add the following lines to the top of it:
>
>  use strict;
>  use vars qw(@ISA @EXPORT_OK %EXPORT_TAGS);
>  @ISA = qw(Exporter);
>  @EXPORT_OK = qw(commonheader commonfooter frameheader framefooter);
>  %EXPORT_TAGS = (':all' => [@EXPORT_OK]);
>
>Then change 'require "site.pl"' to 'use Site qw(:all)'.
>
>This is good practice anyway, even if you weren't getting the error.
>
hiho,

thanks, i changed the scripts as you described but my problem still
exists.

error message:
[Sun Mar  5 21:30:21 2000] [error] Undefined subroutine
&Apache::ROOT::warez_2eperl::navigation_2epl::commonheader called at
/var/httpd/html/warez.perl/navigation.pl line 5.

Site.pm:
use strict;
use vars qw( @ISA @EXPORT_OK %EXPORT_TAGS );
@ISA = qw( Exporter );
@EXPORT_OK = qw( commonheader commonfooter frameheader framefooter );
%EXPORT_TAGS = (':all' => [@EXPORT_OK]);

sub commonheader { my $title = shift; print ... }
sub frameheader { my $title = shift; print ... }
sub commonfooter { print ... }
sub framefooter { print ... }

head of default.pl:
use Site qw(:all);
use strict;
frameheader( "Startpage");

head of navbar.pl:
use Site qw(:all);
use strict;
commonheader( "Navbar");

any further hints ?

ciao -ap
___________________________________________________________________
 
 Andreas Piesk   a.piesk@gmx.net
 pgp fingerprint: 23CB A7E2 2E53 373C  DBCD 8EFC 7777 61C1
___________________________________________________________________

What goes up, must come down. Ask any system administrator.
___________________________________________________________________

Mime
View raw message