shotgunefx has asked for the wisdom of the Perl Monks concerning the following question:
Anyone have any suggestions for improving this? It's worked in my test cases so far. Would one regex (if it's possible) be a better solution or would it just make a slower and more obscure?FILTER_ONLY code => sub { my @code = split (/\n/); # This is suboptimal I'm sure. foreach (@code){ s/findone/FindOne::findfirst/g unless m/\b(for|foreach|while)\W/; } $_ = join ("\n",@code); }
|
|---|