I don't want to separate each class definition out into a a separate file.
If you were truly using classes, you wouldn't have this problem. You're not using classes. You're reinventing modules, and that badly.
Otherwise it adds unnecessary complexity.use mem &{sub(){$::INC{'Dbg.pm'}=1}};
That's necessary complexity? Reimplementing something Perl already knows how to do for you—in an ugly and incomplete fashion—is both necessary and sufficiently simple?
Even the syntax use mem 'Dbg'; would be far less blepharitic—no less obnoxious, but at least it would keep the ugliness to only one spot in your code.
In reply to Re^3: Correct syntax for using $INC to keep modules in same file
by chromatic
in thread can't import using exporter
by perl-diddler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |