diff options
author | Jim Cromie <jcromie@cpan.org> | 2004-05-10 18:15:46 -0600 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2004-05-11 16:35:49 +0000 |
commit | 4a305f6a9139c383ac61b8e258cf614236af6a28 (patch) | |
tree | 51c85c7ce3d6934b5b9c1531e808747ce916e93f /configpm | |
parent | 2dac93e463589fb2cea1827e5c5565faf3fdf9af (diff) | |
download | perl-4a305f6a9139c383ac61b8e258cf614236af6a28.tar.gz |
various -V: searches [PATCH]
Message-ID: <40A06F92.1070607@divsol.com>
p4raw-id: //depot/perl@22810
Diffstat (limited to 'configpm')
-rwxr-xr-x | configpm | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -334,13 +334,18 @@ sub config_re { sub config_vars { foreach (@_) { - if (/\W/) { - my @matches = config_re($_); - print map "$_\n", @matches ? @matches : "$_: not found"; + my ($notag,$qry,$lncont) = m/^(:)?(.*?)(:)?$/; # flags fore and aft, + my $prfx = $notag ? '': "$qry="; # prefix for print + my $lnend = $lncont ? ' ' : ";\n"; # ending for print + + if ($qry =~ /\W/) { + my @matches = config_re($qry); + print map "$_$lnend", @matches ? @matches : "$qry: not found" if !$notag; + print map { s/\w+=//; "$_$lnend" } @matches ? @matches : "$qry: not found" if $notag; } else { - my $v = (exists $Config{$_}) ? $Config{$_} : 'UNKNOWN'; + my $v = (exists $Config{$qry}) ? $Config{$qry} : 'UNKNOWN'; $v = 'undef' unless defined $v; - print "$_='$v';\n"; + print "${prfx}'${v}'$lnend"; } } } |