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';
In reply to Makefile.PL does not always install changed file by williamcharles
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |