If there are many files that will not have a match, this might
actually be faster, because you will save on IO writes. The
perl -i will always write to a new (temporary) file, even if
it turns out the content is the same - after all, Perl can't
know there isn't a match. So, you will do more IO writes,
and your OS goes twice as fast through its buffer cache.
It's hard to say whether a grep is worthwhile. Without
knowing more about the content of the files, I won't dismiss
it.
Abigail