in reply to Good programming practice
If you know what you're doing, and setting them once and using them via a script that you're requireing, then this warning is spurious and you need a way to quell the warning. The easiest way is just to mention it a second time, in a no-op fashion:
Arguably changing your required code into a proper module would force you into a syntax that's more compatible with this warning, but the workaround above should help you for now. A possible syntax I wouldn't be surprised coming out of this:$used_once = "some value"; $used_once; # void context, does nothing
use EmeraldWarp::DBI; # instead of requiring it our $database = "whatever"; ... # the actual "work" is placed in a 'new' subroutine # instead of being executed as part of the loading of # the module my $dbh = new EmeraldWarp::DBI($database); # or just "whatever" and o +mit $database entirely ...
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Good programming practice
by blakem (Monsignor) on Nov 04, 2001 at 12:58 UTC | |
Re: Re: Good programming practice
by tretin (Friar) on Nov 04, 2001 at 10:39 UTC | |
by Aristotle (Chancellor) on Nov 05, 2001 at 02:09 UTC |