in reply to Re: Re: dependencies and loose coupling
in thread dependencies and loose coupling
to the code that uses the sub-classes (that is, the main application)? It sounds like you're trying to give it configuration values without ever giving them. In that case, perhaps you should just use environment variables and be done with it.use BaseClass; BaseClass->connect(args...);
Then you'd set those environment variables in your program (via BEGIN) or beforehand in your shell. It's basically the same as using globals, so if you're allergic to that, then this isn't for you either. ;)package BaseClass; sub connect { ... $dbh = DBI->connect($ENV{PERRIN_DBI}, $ENV{PERRIN_USR}, $ENV{PERRIN_ +PWD}); ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: dependencies and loose coupling
by perrin (Chancellor) on May 12, 2004 at 23:42 UTC |