in reply to One more question about building a multimodule distribution

Using ExtUtils::ModuleMaker it is easy to create multiple modules. From the synopsis,
use ExtUtils::ModuleMaker; Generate_Module_Files ( NAME => 'Sample::Module::Foo', ABSTRACT => 'a sample module', AUTHOR => {NAME => 'A. U. Thor', EMAIL => 'a.u.thor@a.galaxy.far.far.away', CPANID => 'AUTHOR', WEBSITE => 'http://a.galaxy.far.far.away/mod +ules', }, VERSION => 0.01, LICENSE => 'perl', EXTRA_MODULES=> [ { NAME => 'Sample::Module::Bar', ABSTRACT => 'a second module', }, { NAME => 'Sample::Baz', ABSTRACT => 'a third module', }, ], );
So it seems that the work of adding modules is linear in the number of modules, a reasonable scaling to me.

If your modules all have very similar names you could populate the EXTRA_MODULES array with a loop:
my $root = 'Foo::Bar::'; my @extras; my @leaves = qw|Baz Plugh Xyzzy|; foreach (@leaves) { push @extras, { NAME => $root . $_, ABSTRACT => "$_ module", }; }
-Mark

Replies are listed 'Best First'.
Re: Re: One more question about building a multimodule distribution
by bronto (Priest) on Jun 26, 2002 at 20:34 UTC
    From the synopsis,...So it seems that the work of adding modules is linear in the number of modules, a reasonable scaling to me.

    Me too! :-)

    I referred the non-scalability to the approach I found in the tutorial, namely:

    So as you can see all you need to do is make a Bar/ directory in your root dir and place Baz.pm in this. If you want h2xs to write the Baz.pm stub.....don't bother! Simply do this:
    $ cd Foo-Bar-0.01 $ mkdir Bar $ cp Bar.pm ./Bar/Baz.pm $ cd Bar $ perl -pi.bak -e 's/Foo::Bar/Foo::Bar::Baz/g' Baz.pm $ rm Baz.pm.bak

    which is not very scalable, IMHO...

    Thanks kvale, I didn't get it when I read the doc. I'll try it ASAP!

    Ciao!
    --bronto

    # Another Perl edition of a song:
    # The End, by The Beatles
    END {
    
      $you->take($love) eq $you->made($love) ;
    }