From: Andreas J. Koenig Date: Fri, 27 Jun 1997 05:21:14 +0000 (+1200) Subject: Don't use undef value in Config::myconfig X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=754da6387aaed7d7ca907de8ac487143097ad5e3;p=p5sagit%2Fp5-mst-13.2.git 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 --- 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;