in reply to Re^2: multiple "sub" packages in 1 file: possible? how?
in thread multiple "sub" packages in 1 file: possible? how?

One more way to do it:
package my::foo; BEGIN { $INC{'my/foo.pm'} ||= 'dev/null'; } require exporter; # etc. package main; use my::foo;
The addition to %INC tells use/require that the package is already in memory, so it won't try to load it again.

Search, Ask, Know