in reply to Re^4: Installing a script
in thread Installing a script

I can admit when I am wrong. Right after the PL_FILES option is the PM options which does control that.

Replies are listed 'Best First'.
Re^6: Installing a script
by ikegami (Patriarch) on Aug 24, 2009 at 17:26 UTC

    If EXE_FILES works, I'd use that.

    The problem with PM is that if you use it, it prevents automatic discovery of (other) .pm files. I had to add to some generated .pm files to PM and I didn't want to list all the static .pm files, so I added the following to Makefile.PL:

    BEGIN { package MY; use File::Spec::Functions qw( catdir catfile ); sub init_PM { my $self = shift; $self->SUPER::init_PM(@_); my @path = qw( ... ); my $src_base = catdir('lib', @path); my $dst_base = join('$(DIRFILESEP)', '$(INST_LIB)', @path); for (...) { my $src = catfile( $src_base, "$_.pm"); my $dst = join('$(DIRFILESEP)', $dst_base, "$_.pm"); $self->{PM}{$src} = $dst; } } }

    So to add a .pl, you'd use

    BEGIN { package MY; use File::Spec::Functions qw( catdir catfile ); sub init_PM { my $self = shift; $self->SUPER::init_PM(@_); my $src_base = 'bin'; my $dst_base = '$(INSTALLSCRIPT)'; for ('script.pl', ...) { my $src = catfile( $src_base, $_); my $dst = join('$(DIRFILESEP)', $dst_base, $_); $self->{PM}{$src} = $dst; } } }