in reply to Package Application for CPAN

See the docs, perlmodstyle, perlnewmod, CPAN, ExtUtils::MakeMaker, h2xs. You'll probably get advice to use some newer builders, but make sure you get the standard ways working first.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re^2: Package Application for CPAN
by qumsieh (Scribe) on Sep 15, 2004 at 20:44 UTC
    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?

      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

      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.

      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.

Re^2: Package Application for CPAN
by Pragma (Scribe) on Sep 15, 2004 at 22:54 UTC
    You'll probably get advice to use some newer builders
    Can you elaborate on this?