in reply to Creating a library
You don't need to mark those variables as global. You can simply put everything in a package and use some accessors
How about that?
In the code that uses that you can then simply dopackage SqlStatements; sub report_by_date { return q{ SELECT ... FROM ... WHERE ... }; }
use SqlStatements; #or require or do or whatever you like my $sql = SqlStatements->report_by_date(); my $sth = $dbh->prepare($sql); ...
Flo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Creating a library
by dracos (Sexton) on Mar 13, 2006 at 20:49 UTC |