On Fri, Aug 12, 2005 at 01:32:16AM +0000, Yu Wang wrote:
> I am a newbie in Perl programming. I have written a simple application and 
> now I
> want to write a Makefile.PL, that can accomplish the following steps:
> 
> 1. Check if the required package exists. If no, stop.

For this you use PREREQ_PM, except it will warn rather than dying.  Dying
when a module is missing is not recommended as it makes automated installs,
which can resolve dependencies themselves, difficult.

        PREREQ_PM => { Some::Module => 1.23 }


> 2. Copy bin, lib and doc directories to $PREFIX

lib/ is handled by MakeMaker automatically.

For bin you need to use EXE_FILES to let MakeMaker know what's an executable
to be installed.

        EXE_FILES => ['bin/program'],

Stand alone documentation is difficult in MakeMaker.  I'd recommend you 
simply use POD as part of your libraries and programs and let the user read 
it with perldoc.  Additionally, $PREFIX/doc is a bit of a non-standard
location for Perl modules and its likely the user will never see the 
documentation.


> 3. Add $PREFIX/lib to @INC in the main program.

I would recommend not bothering and let the user take care of setting their
PERL5LIB properly as its kind of difficult to figure out where the
library is ultimately going to be installed.  Its also kinda difficult.


-- 
Michael G Schwern     [EMAIL PROTECTED]     http://www.pobox.com/~schwern
...they shared one last kiss that left a bitter yet sweet taste in her 
mouth--kind of like throwing up after eating a junior mint.
        -- Dishonorable Mention, 2005 Bulwer-Lytton Fiction Contest 
           by Tami Farmer

Reply via email to