in reply to Package Globals and mod_perl
GlobalTest.pm
gt.cgipackage GlobalTest; $GLOBALA = 10; 1;
gt2.cgi#!/usr/bin/perl use GlobalTest; print "Content-type: text/plain\n\n"; print $GlobalTest::GLOBALA;
I then ran gt2.cgi about 10 times (to make sure all my instances of apache had loaded it). When I ran gt.cgi, I got the answer of 30, not of 10.#!/usr/bin/perl use GlobalTest; print "Content-type: text/plain\n\n"; $GlobalTest::GLOBALA=30; print $GlobalTest::GLOBALA;
So, yes, package globals stick around regardless of the calling CGI when using mod_perl; at least with this scenerio.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re: Package Globals and mod_perl
by tye (Sage) on May 16, 2001 at 21:38 UTC | |
by mr.nick (Chaplain) on May 16, 2001 at 21:56 UTC | |
by shotgunefx (Parson) on May 17, 2001 at 02:50 UTC | |
by shotgunefx (Parson) on May 17, 2001 at 02:28 UTC |