perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Piesk <a.pi...@gmx.net>
Subject problem with cache ?
Date Sun, 05 Mar 2000 20:09:30 GMT
hiho,

after solving the problem with apachedbi (thanks edmund), i've
encountered another. i'm porting a site from asp to php/perl in order
to compare the different scripting languages.

ok, here's my problem:

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;

ok, now i have written 2 scripts, default.pl (the startpage) and
navbar.pl (the navigation bar page).

content of default.pl:

use strict;
require "site.pl";
frameheader( "Startpage");
# some blabla
framefooter();

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.

for testing i created 2 scripts. both include site.pl. one calls
commonheader(), and the other frameheader(). if i execute the
commonheader-script first i got an error message "undefined sub
frameheader" when executing the frameheader script. and vice versa.

if i change the "require site.pl" into "do site.pl" it works but i get
everytime i call a sub the message "sub <blabla> redefined at site.pl
line ??". 

what can i do against this behaviour ? or made i something completely
wrong ?

ciao -ap

p.s.: sorry if this is trivial but i haven't found an explanation in
my perl docs.
___________________________________________________________________
 
 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