Any ideas on how I can avoid 4000 lines of many module subs in one source file?
Um ... put package Mod; at the top of each of Mod-part1.pm and Mod-part2.pm?
The package statement doesn't propagate beyond file boundaries so you need to be explicit in your individual files
Update: Sorry, I didn't see what you had written about use base (that's what I get for skimming rather than reading). Hmm. You can always declare your subs like this:
sub Mod::foo { ... }
And if variables are a problem too, then you would add
use vars qw($Mod::var1 $Mod::var2 @Mod::var3 %Mod::etc);
at an appropriate place. Note that this still won't make __PACKAGE__ have the value of Mod
Why are you using __PACKAGE__ anyway? Do you need to? As chromatic said, perhaps you need to re-think your design.
Also, you can always redeclare everything at the top of each module part:
# Mod-part1.pm package Mod; use base qw(Meta); ... # Mod-part2.pm package Mod; use base qw(Meta); ...
In reply to Re: organizing large flat modules? use, require, do, ...
by duff
in thread organizing large flat modules? use, require, do, ...
by halley
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |