From 754da6387aaed7d7ca907de8ac487143097ad5e3 Mon Sep 17 00:00:00 2001 From: "Andreas J. Koenig" Date: Fri, 27 Jun 1997 17:21:14 +1200 Subject: [PATCH] Don't use undef value in Config::myconfig Subject: Config->myconfig not -w clean Thanks to a report by Larry Virden I spotted a bug in Config.pm. Undefined values trigger "Use of undefined value" messages, e.g. # perl -MConfig -we 'print Config->myconfig' Use of uninitialized value at /usr/local/lib/perl5/IP22-irix/5.004/Config.pm line 553. Use of uninitialized value at /usr/local/lib/perl5/IP22-irix/5.004/Config.pm line 553. Use of uninitialized value at /usr/local/lib/perl5/IP22-irix/5.004/Config.pm line 553. Use of uninitialized value at /usr/local/lib/perl5/IP22-irix/5.004/Config.pm line 553. Summary of my perl5 (5.0 patchlevel 4 subversion 0) configuration: Platform: [...] I'd suggest this simple patch: Credited: Chip Salzenberg p5p-msgid: 199706271525.RAA13517@sissy.in-berlin.de --- configpm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/configpm b/configpm index fcf4e3d..2a22bfc 100755 --- a/configpm +++ b/configpm @@ -79,6 +79,13 @@ my $summary_expanded = 0; sub myconfig { return $summary if $summary_expanded; + $summary =~ s{ + \$(\w+) + }{ + defined $Config{$1} + ? $Config{$1} + : "not defined" + }xge; $summary =~ s/\$(\w+)/$Config{$1}/ge; $summary_expanded = 1; $summary; -- 2.7.4