in reply to Re: Thoughts on variable sharing in mod_perl
in thread Thoughts on variable sharing in mod_perl

++ perrin, you where spot on. I'm using Apache::Request and so even when I declare a variable that would normally still be in the same scope as the sub I get these problems.

I think a package of constants sounds like the best solution so I'll start on that.

I've been avoiding OO until I get a little more comfortable with perl (seeing as this is my first project I've written).
  • Comment on Re: Re: Thoughts on variable sharing in mod_perl

Replies are listed 'Best First'.
Re: Re: Re: Thoughts on variable sharing in mod_perl
by Cine (Friar) on Aug 24, 2001 at 02:40 UTC
    You dont need any OO for this... A normal module will do just fine...
    package Config; use strict; my %config = { #Init your variables in %config }; 1;
    in your apache/perl startup file (the one you call from httpd.conf. You do have such a file right???) you write use Config; And your config will be avail to all script in $Config::config.... Or you could do something similar with constants...

    T I M T O W T D I