deprecated has asked for the wisdom of the Perl Monks concerning the following question:
But then it occurred to me that perhaps I would be able to be a little more flexible with a sub. So I came up with something like this:$Storable::forgive_me = 1;
However, I dont want the user to have any warnings if they arent interested in debugging because they dont have Data::Dumper or (isnt it part of the core) Carp. I looked through perldoc perlmod and also through perldoc -f use and perldoc -f require. I havent seen whether it gets use'd every time, or whether it only gets called when its needed.Package DebugMe; use vars qw( $dl ); # debug level sub debug { use Carp; use Data::Dumper; $dl |= shift; } # so the usage would be this: DebugMe::debug( 1 ); # change debugging level to 1 DebugMe::debug( 2 ); # change degbugging level to 2
Could somebody clarify this for me?
Thanks,
brother dep.
--
Laziness, Impatience, Hubris, and Generosity.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 1: OO Debugging Schemes (akin to Storable.pm)
by tilly (Archbishop) on Apr 20, 2001 at 05:44 UTC | |
|
Re: OO Debugging Schemes (akin to Storable.pm)
by merlyn (Sage) on Apr 20, 2001 at 00:22 UTC |