Re: Bug in Makefile.PL for 5.18

Gisle Aas (gisle@aas.no)
17 Dec 1997 01:25:35 +0100


Pon Hwa Lin <koala@fragment.com> writes:

> The Makefile.PL for libwww-perl 5.18 generates an incorrect postamble
> section for the Makefile. As a result, the GET, POST and HEAD aliases do
> not get installed when `make install' is invoked.

So it appears.

> The culprit appears to be the `package MY' declaration. Reverting to the
> `sub MY::postamble {...' notation used in 5.17 or using an expanded
> `@main::request_aliases' notation for the variables in the subroutine 
> should solve the problem.

Another possibility is to my-ify these variables.  The following patch
is the fix that will make it into 5.19.  "use strict" should ensure
that I don't make such a mistake again.

Thanks for the report.

Regards,
Gisle



Index: Makefile.PL
===================================================================
RCS file: /home/cvs/aas/perl/mods/libwww-perl/Makefile.PL,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -u -r1.44 -r1.45
--- Makefile.PL	1997/12/03 21:36:08	1.44
+++ Makefile.PL	1997/12/17 00:15:23	1.45
@@ -1,20 +1,22 @@
 # This -*- perl -*- script writes the Makefile for libwww-perl
-# $Id: Makefile.PL,v 1.44 1997/12/03 21:36:08 aas Exp $
+# $Id: Makefile.PL,v 1.45 1997/12/17 00:15:23 aas Exp $
+
+require 5.004;
+use strict;
 
 #--- Configuration section ---
 
-@programs_to_install = qw(lwp-request lwp-mirror lwp-rget lwp-download);
-@request_aliases     = qw(GET HEAD POST);
+my @programs_to_install = qw(lwp-request lwp-mirror lwp-rget lwp-download);
+my @request_aliases     = qw(GET HEAD POST);
 
 #--- End Configuration - You should not have to change anything below this line
 
-require 5.004;  # LWP needs this perl version
 
 # Allow us to suppress all program installation with the -n (library only)
 # option.  This is for those that don't want to mess with the configuration
 # section of this file.
 use Getopt::Std;
-$opt_n = undef;   # avoid -w typo waring
+use vars qw($opt_n);
 unless (getopts("n")) {
     die "Usage: $0 [-n]\n";
 }