in reply to Setting up helper objects in App::Cmd
I'd generally name my modules things like:
And instead of loading library modules at compile time with use MyApp::Lib::Database, defer loading to run-time (with require MyApp::Lib::Database) inside your command's execute method. This means that you can avoid loading up database connections, etc when the user is just running, say, myapp help. Load them only once they're needed.
PS: a release using this technique is P5U.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Setting up helper objects in App::Cmd
by McA (Priest) on Sep 25, 2012 at 11:22 UTC |