X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=configpm;h=4f301c38fa5464bb4d4501fa1a405faea7ca7e4b;hb=91451e42347a75e822ac69341556a66aff081878;hp=f232c9b4ede95e483e38fa963e90f69f3ff9360d;hpb=90ec21fbf67fdb98944b5ea5e45d428d16982933;p=p5sagit%2Fp5-mst-13.2.git diff --git a/configpm b/configpm index f232c9b..4f301c3 100755 --- a/configpm +++ b/configpm @@ -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"; } } } @@ -435,8 +440,8 @@ Config - access Perl configuration information =head1 SYNOPSIS use Config; - if ($Config{'cc'} =~ /gcc/) { - print "built by gcc\n"; + if ($Config{usethreads}) { + print "has thread support\n" } use Config qw(myconfig config_sh config_vars config_re);