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?

package SqlStatements; sub report_by_date { return q{ SELECT ... FROM ... WHERE ... }; }
In the code that uses that you can then simply do
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
    <Insert Head smaking sound here>
    Aparently I was stuck in the mindset of thinking of variables as soon as I read your reply I had one of thoes DUH moments.
    Thanks
    ron...