You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Kenny Smith <ke...@journalscape.com> on 2001/10/30 22:20:51 UTC

Persistant Data shared with other applications

Hi there,

I'm seeing a strange bit of behavior and wanted to find out if anyone else
is having this problem.

I have two scripts, index.mod_perl and grapevine.mod_perl.

They both use HTML::Template to generate their output. The template is not
persistant between requests, but $main::tokens is persistant. $main::tokens
is hashref that contains a page title variable which is passed to the
template. The index.mod_perl's tokens contains the page title "Employee
Portal"  and the grapevine.mod_perl contains the page title "Grapvine
Employee Utility." They both use the same html header file during output,
which is customized by the page_title token.

My problem is that sometimes, when I go to grapevine.mod_perl, it shows me
the "Employee Portal" title. It seems that $main::tokens from index.mod_perl
is being shared as $main::tokens to grapevine.mod_perl.

Has anyone had this kind of thing happen?

Kenny Smith


Re: Persistant Data shared with other applications

Posted by ryc <ii...@binary.net>.
Yes that situation can occur when the two files are part of the same
package... despite having different file names mod_perl treats them as the
same since they have the same package name. This will give you the strange
behavior that you just described. Could this be your problem?

ryan

----- Original Message -----
From: "Kenny Smith" <ke...@journalscape.com>
To: "Modperl" <mo...@apache.org>
Sent: Tuesday, October 30, 2001 3:20 PM
Subject: Persistant Data shared with other applications


> Hi there,
>
> I'm seeing a strange bit of behavior and wanted to find out if anyone else
> is having this problem.
>
> I have two scripts, index.mod_perl and grapevine.mod_perl.
>
> They both use HTML::Template to generate their output. The template is not
> persistant between requests, but $main::tokens is persistant.
$main::tokens
> is hashref that contains a page title variable which is passed to the
> template. The index.mod_perl's tokens contains the page title "Employee
> Portal"  and the grapevine.mod_perl contains the page title "Grapvine
> Employee Utility." They both use the same html header file during output,
> which is customized by the page_title token.
>
> My problem is that sometimes, when I go to grapevine.mod_perl, it shows me
> the "Employee Portal" title. It seems that $main::tokens from
index.mod_perl
> is being shared as $main::tokens to grapevine.mod_perl.
>
> Has anyone had this kind of thing happen?
>
> Kenny Smith
>