in reply to Re^3: Module Bloat and the Best Solution
in thread Module Bloat and the Best Solution
So, is it copy/paste programming if I use for my $i ( 1 .. 10 ) { in two different programs?
Should I do that as:
use Useful::For qw[ ForRange ]; ForRange \my $i, 1, 10, { print $$i; }
?
How about a Useful::If, and a Useful::While and a ...
Of course, now all our programs have to start with:
use Useful::For qw[ ForRange ]; use UseFul::If; use UseFul::While; ...
But that is so repetative. That has to be a candidate for a module right!
use Useful; Use qw[ For If While ]; ...
But hang on. We lost the ability to select individual routines from each module. We have to fix that, so:
use Useful; Useful { For => qw[ ForRange ], If => qw[ :all ], While => qw[ :all ], };
Better, but still a lot of C&P. How about:
use Perl qw[ :all ];
Perfect!
|
---|