On 11 Mar 2004, Skylos the Doggie wrote:
> My solution to this problem is to pass EVERYTHING.  I don't rely on
> any subroutine to know Any data that isn't passed to it
> *explicitly*.  Using global or even local or even package variables
> is baad here.

So if I want to have a database that is constantly available, I have
to pass the connection details to every subroutine that runs? I'm not
complaining here, it just seems like there's got to be another
way... Although I'm definitely running short on ideas. Like I said in
a previous e-mail, I'd love to see an example mod_perl app (with
packages) that runs multiple copies off multiple databases
simultaneously. Know of any? TIA.

> I advise either instancing yourself your own object to hold your
> variables which holds all your methods (subroutines)

Any good examples? I haven't yet ventured into OOP with Perl...

> or passing all these values to your subroutines, or defining your
> subroutines at execution time to anonymous variables.

I don't know if, at a glance, the latter will work. I've got 15,000
lines of code and that seems like a fairly major change...

Thanks

Brett.

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

Reply via email to