Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^5: Installing a script

by Anonymous Monk
on Aug 24, 2009 at 07:32 UTC ( #790764=note: print w/replies, xml ) Need Help??


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 (Pope) 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; } } }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://790764]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2018-07-17 00:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (353 votes). Check out past polls.

    Notices?