in reply to OO Debugging Schemes (akin to Storable.pm)

Both Data::Dumper and Carp are part of the core.

BTW you have a typo. You clearly want ||=, not |=. (Logical or, not bitwise.)

As for your package, the right way IMHO to do it is to have a method or function for debugging that you can call, that you always call, and have that test the debug level against the level to output the warning for...

  • Comment on Re (tilly) 1: OO Debugging Schemes (akin to Storable.pm)