DCPM: Can Makefile.PL accept command-line parameters?

Matthew Browning mb at matthewb.org
Sun Nov 16 02:59:53 CST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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 
PREFIX option.  

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 
on this?

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:

http://search.cpan.org/~vparseval/File-Locate-0.01/Locate.pm

MB (sorry if I've missed the point)

- -- 
http://matthewb.org/public_key.txt

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/tzyPy5o0lRFL2ooRArd3AKDrkf3Mnxky/FKtN7yi+QJFsd9A+ACgil9H
aDnXQYkslDs/xOQa7SJ/mhw=
=CyVk
-----END PGP SIGNATURE-----



More information about the Devoncornwall-pm mailing list