I don't like Perl::Install, it seems ambiguous. Example: Perl::Install::Java. Does this mean it installs Java? Perl::Install would then appear to be a base module for Perl::Install::Java.

How about Perl::Installation? It is a minor difference from Perl::Install; especially since there are so many Foo::Install modules but I do think it is a little clearer in what it is supposed to do.

As for dependencies Module::Build has calls for getting information from the user, it is called prompt().

Example from a Build.PL script I wrote, (Note: This is not a complete script).

my $code<<"END"; ## Your custom installation code goes here END; use Module::Build; my $class = Module::Build->subclass( class => 'Custom::Build', code => $code, ); my $builder = $class->new( # You need to add some of your stuff here! ) if ($builder->args('default') or $builder->args('quick-install')) { my %notes = _get_default_settings(); foreach (keys %notes) { $builder->notes( $_ => $notes{$_} ) } } else { my %notes = _get_prompt_settings(); foreach (keys %notes) { $builder->notes( $_ => $builder->prompt( $notes{$_}{message}, $notes{$_}{default} )) } } $builder->create_build_script(); exit; ################################################# sub _get_default_settings { warn "OS is $OSNAME\n"; if ($OSNAME eq 'MSWin32') { return ( config => 'c:/EEBL/tmp', cgi => 'c:/EEBL/tmp/cgi', tmpl => 'c:/EEBL/tmp/tmpl', url => '/EEBL', ) } else { return ( config => '/var/www/eebl', cgi => '/var/www/eebl/cgi', tmpl => '/var/www/eebl/tmpl', url => '/EEBL', ) }; }; ################################################# sub _get_prompt_settings { my %settings = _get_default_settings; return ( config => { message => 'Where will the config.txt file be installed?', default => $settings{config}, }, cgi => { message => 'Where will the cgi files be installed?', default => $settings{cgi}, }, tmpl => { message => 'Where will the template files be installed?', default => $settings{tmpl}, }, url => { message => 'What is the root url for the web site?', default => $settings{url}, }, ); }

Hope this gets your started.


In reply to Re: CPANization of a script for building Perl by Herkum
in thread CPANization of a script for building Perl by dragonchild

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.