srins has asked for the wisdom of the Perl Monks concerning the following question:

Hi,
I am having an issue when i was using mod_perl .I am using apache 2 and mod_perl version 2.
I have changed my cgi script to mod_perl ,to enhance the perfomance and speed ,which was very slow when i am using cgi.In doing so, when multi user attempt to click the link ,i am getting all user data instead of getting my data only.Suppose there is an link called user profile ,when i click the userprofile link ,i should get my user profile.But I am getting all others user profile those who have hit the link.How to control my script in multiuser environment in mod_perl.Any change in code is necessary? or do i need to do any configuration?.please help me in this regard.
Thanks,
srins.
  • Comment on how to control my script in multiuser env using mod_perl.

Replies are listed 'Best First'.
Re: how to control my script in multiuser env using mod_perl.
by TedYoung (Deacon) on Dec 01, 2005 at 17:36 UTC

    I assume this is in relation to your last note: how to convert my existing cgi page to mod_perl.. Mod_perl and CGI are very different environments. The conversion of one to another is far from trivial. With out any code examples, or lists of what you have tried, it would be impossible to guess what you are doing wrong. I would strongly suggest you thoroughly read the mod_perl doc links given to you in your previous post and get an understanding for how mod_perl works and how it affects your scripts.

    Ted Young

    ($$<<$$=>$$<=>$$<=$$>>$$) always returns 1. :-)
Re: how to control my script in multiuser env using mod_perl.
by Fletch (Bishop) on Dec 01, 2005 at 17:37 UTC

    Well it's obvious from the code you've posted where the error is.

    Erm, well aside from that in all likelihood your former CGI was dependent on variables being cleared when it exited. Under mod_perl they're persisting between invocations so you're seeing data accumulated over several runs. The mod_perl guide discusses how to port CGIs to mod_perl, and you may want to check out Apache::PerlRun (or it's mod_perl2 analogue; which I can't remember the name of since I haven't touched mod_perl in aeons); that module is a bit more agressive than Apache::Registry in clearing things out making a more CGI-like environment (at the cost of more overhead each request, of course).

Re: how to control my script in multiuser env using mod_perl.
by Joost (Canon) on Dec 01, 2005 at 18:06 UTC