X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Porting%2Ffindvars;h=3cdb854614da7b4649d3503571c996284bf26eea;hb=d653c6f5cfd47fd6d82c68d8013461da4731be40;hp=b91753bbbe29c8d164c52bd382902f8361cb7456;hpb=8e52752b5f49a78716f0f99e5101dfe233b32cb0;p=p5sagit%2Fp5-mst-13.2.git diff --git a/Porting/findvars b/Porting/findvars index b91753b..3cdb854 100755 --- a/Porting/findvars +++ b/Porting/findvars @@ -11,15 +11,17 @@ chop $pat if $pat =~ /\|$/; # grep while (<>) { - if (/^(.*?)\b($pat)\b(.*)$/o) { - my $head = "$1#$2#"; - $_ = $3; - while (/^(.*?)\b($pat)\b(.*)$/o) { - $head .= "$1#$2#"; - $_ = $3; - } - print "$ARGV\:$.\:$head$_\n"; - } + print "$ARGV\:$.\:$_" if s/\b($pat)\b/#$1#/og; +# this variant might useful if the transformation is more complicated +# if (/^(.*?)\b($pat)\b(.*)$/o) { +# my $head = "$1#$2#"; +# $_ = $3; +# while (/^(.*?)\b($pat)\b(.*)$/o) { +# $head .= "$1#$2#"; +# $_ = $3; +# } +# print "$ARGV\:$.\:$head$_\n"; +# } } continue { close ARGV if eof;