DCPM: Can Makefile.PL accept command-line parameters?
mb at matthewb.org
Sun Nov 16 02:59:53 CST 2003
-----BEGIN PGP SIGNED MESSAGE-----
On Saturday 15 November 2003 15:08, Neil Williams wrote:
[ snipped example ]
> I'm looking for a more elegant way of doing it, so that instead of:
> perl -MCPAN -e 'install Net::Z3950'
> I can use:
> download NetZ3950.pm
> apply patch to Makefile.PL
> perl Makefile.PL --prefix /home/siteuser/path/
> Although I suspect Perl won't do that.
> The path will differ for each user of the patch and I'm trying to
> reduce the workload / confusion.
I would definitely not call the argument `prefix' if I was doing this -
there is a clear possibility for confusion between that and the common
Reducing confusion is good but I'd also be concerned about breaking the
expected behaviour of a Makefile.PL - anyone else got a better opinion
You could use Getopt::Long (standard module) to capture the
command-line argument and die with a usage message if the arg is not
supplied nor hard-coded.
I wonder if it might be possible to also try using `locate' in the
script to find the yaz binary? Had a late night last night and suspect
my reasoning may be a little off-centre still but it sounds like it
might be worth a try...hmm, seems someone has done a spectacularly
pointless module for this:
MB (sorry if I've missed the point)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
-----END PGP SIGNATURE-----
More information about the Devoncornwall-pm