williamcharles has asked for the wisdom of the Perl Monks concerning the following question:
I have a Makefile.PL which creates a module say 'My_Config.pm' (Makefile.PL prompts for user password and stores it in 'My_Config.pm)' under the lib directory using some predefined template.
Upon perl Makefile.PL && make the file 'My_Config.pm' is created under lib/ When performing make install the 'My_Config.pm' is not always installed. Even if the file contains changes, the file is not always installed.
I am using File::ShareDir::Install 'postamble';
Any hints on what may be the problem here?
TIA
Edit 1:My_Config.tmpl
Makefile.PLpackage My::Module::Name::My_Config; use strict; use warnings; use Exporter; our @ISA = 'Exporter'; our @EXPORT_OK = 'MY_PASSWORD'; our %EXPORT_TAGS =(CONSTANTS => ['MY_PASSWORD']);
use strict; use warnings; use ExtUtils::MakeMaker; WriteMakeFile( NAME => 'My::Module::Name', AUTHOR => 'XYZ', VERSION_FROM => 'lib/My/Module/Name.pm' ); package MY; sub xs_o { my $pass = MM->prompt('Enter password'); chomp($pass); my $tmpl = 'My_Config.tmpl'; my $config = 'lib/My/Module/Name/My_Config.pm'; return <<END; all: myconfig myconfig: \tperl -e 'open(IN, "<" , "$tmpl"); open(OUT, ">", "$config"); while(< +IN>) { print OUT $_; } close(IN); close(OUT);' \tperl -e 'open(OUT, ">>", "$config"); print OUT "use constant MY_PASS +WORD => qq($pass);\\n1;"; close(OUT);' END } use File::ShareDir::Install 'postamble';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Makefile.PL does not always install changed file
by haukex (Archbishop) on Jun 12, 2019 at 18:42 UTC | |
by williamcharles (Novice) on Jun 13, 2019 at 06:34 UTC | |
by haukex (Archbishop) on Jun 16, 2019 at 09:48 UTC | |
|
Re: Makefile.PL does not always install changed file
by stevieb (Canon) on Jun 12, 2019 at 22:07 UTC | |
|
Re: Makefile.PL does not always install changed file
by daxim (Curate) on Jun 13, 2019 at 08:55 UTC | |
by Anonymous Monk on Jun 14, 2019 at 00:53 UTC | |
|
Re: Makefile.PL does not always install changed file ( postamble )
by Anonymous Monk on Jun 14, 2019 at 01:02 UTC |