in reply to Re: Package Application for CPAN
in thread Package Application for CPAN

Thanks. I have a healthy CPAN directory and know my way around h2xs and how to create a module package. But somehow I didn't think this was the "correct" way to go when packaging a complete application. Now that you made me think more about it, I think it will be the best solution.

One question though, where will

make install
place the .pl file? I assume it'll go in @INC somewhere (or wherever PREFIX points to). Is this a good place for it to end up?

Replies are listed 'Best First'.
Re^3: Package Application for CPAN
by tachyon (Chancellor) on Sep 15, 2004 at 23:44 UTC

    where will make install place the .pl file?

    As always it depends. If you do nothing and have used h2xs to build your skeleton it will simply get dumped in the same location as your .pm files. To install a .pl script (say it is at DISTRO/bin/foo.pl in your distro) into a bin dir you modify the Makefile.PL like this:

    use ExtUtils::MakeMaker; WriteMakefile( 'NAME' => 'Foo', 'VERSION_FROM' => 'Foo.pm', 'EXE_FILES' => ['bin/foo.pl'], # <--- Add list of .pl exe +files to install );

    The foo.pl script will now be installed in an architecture dependent bin dir. This will proabably allow the user to just type foo.pl as it will *probably* be in their path. On win32 a .bat file will also be automatically generated. You can control the install location with perl Makefile.PL PREFIX=blah This affects both .pm and exe_files. LIB controls compiled binary install location if you have C/XS code.

    cheers

    tachyon

Re^3: Package Application for CPAN
by ikegami (Patriarch) on Sep 15, 2004 at 21:59 UTC
    I believe the default is hardcoded into perl. It can be overridden by the user by specifying extra args to perl Makefile.PL, possibly as follows: perl Makefile.PL PREFIX=~. Refer to ExtUtils::MakeMaker.

    Update: A .pl file? oops, I don't know how .pl works, just modules.

Re^3: Package Application for CPAN
by castaway (Parson) on Sep 16, 2004 at 08:57 UTC
    There are several CPAN modules which also contain 'executeables'.. They usually land in the same directory as the perl binary itself. Looking at the Makefile.PL for Prima (which was the first one I thought of), it does some complicated stuff to put its executeables somewhere useful.. Ah, and looking at DBI::Shell, it could have avoided all that by using:     EXE_FILES => [ "dbish$ext_pl" ], or similar, that's probably what you want.

    C.