in reply to Re: CPAN to install Applications
in thread CPAN to install Applications

Where would declare your code for calling the executable?

I can write a script to install the templates to a location but I cannot found in the documentation where you set a script to that is run during the ./Build install process.

Replies are listed 'Best First'.
Re^3: CPAN to install Applications
by philcrow (Priest) on Mar 10, 2006 at 21:02 UTC
    There are two types of things to install: executables and other things. For executables simply add a scripts key to your hash:
    use Module::Build; my $build = Module::Build->new( module_name => 'YourName', # ... script_files => [ qw( your scripts here ) ], #... ); $build->create_build_script;
    To do other things takes a bit more work:
    my $subclass = Module::Build->subclass( class => 'My::Builder', code => &_custom_code(), ); my $build = $subclass->new( module_name => 'YourName', script_files => [ qw( same as above ) ], #... ); $build->create_build_script; sub _custom_code { return <<'EO_CODE'; sub ACTION_install { # do whatever you want at the end of install } EO_CODE }
    Note that shelling out to other scripts is probably not ideal (but is legal). Rather, we code all the file copying, etc in the Build.PL using pure Perl.

    Phil