in reply to Re: positive regex for inverted match
in thread positive regex for inverted match

I think that is a good suggestion. But perhaps it would be a good idea to take the flag as the second parameter (and use it optional) like this:
sub do_selection ($;$) { my $match = shift; my $flag = shift || 0; ...
In this case you don't have to change lots of other calls of do_selection.