On 22 Jun 2000, at 17:51, Perrin Harkins wrote:
> On Thu, 22 Jun 2000, Scott Alexander wrote:
> > I then have an Initialize_globals function that I run to reset all the
> > variables at the begining of a request.
> Why would you reset all of your configuration globals at the beginning of
> a request?
Safety more then anything else.  This just makes sure that If 
anything gets changed in the previous request,  it doesn't affect the 
other requests.
 
> > I thought I should be able to access them using
> > $Mf7::Globals::imgserver but this just errors out with unitialized
> > variable.
> That should work.  Maybe you could post a little code snippet?  You are
> using actual global variables in Mf7::Globals, right?
np. I removed everything but the imgserver variable out of it.  
otherwise it was/is pretty big.
package Mf7::Globals;
use strict;
use vars qw($VERSION);
        my (
        $imgserver,
        );
$VERSION = '0.01';
sub Initialize_globals {
$imgserver = 'http://www.musiciansfriend.com';
}
1;
__END__
 
then a test i've been running:
#!/usr/local/bin/perl -w
use Mf7::Globals;
use strict;
Mf7::Globals::Initialize_globals();
print "$Mf7::Globals::imgserver\n";

This sends :
Use of uninitialized value in concatenation (.) 
at test.file line 5.


If it came down to it,  I can make the change as 
this code isn't near going live yet, but i'd 
prefer to keep them referenced this way since 
I've already made it through all the files(29) 
and updated all of them to be 
$Mf7::Globals::varname.

> Incidentally, the MF site is pretty fast.  Is it running on mod_perl now?
Yep. Mod_perl and Apache::Registry saved us from having to get a 
ton of new hardware.  I don't remember my exact benchmarks, but 
we were hitting huge loads on the code base before Mod_perl with 
just a couple of hits(it was in development, so we were just testing) 
 once we moved to mod perl,  we only had one real questionable 
time where our load hit 160.  Once we brought in the second box 
though,  our load has been nothing.

Scott

Reply via email to