in reply to Re: Using grep to find "/<file system"
in thread Using grep to find "/<file system"

A couple of points regarding the readability of your solution. By choosing a regex delimiter other than the standard '/' you would not have to escape the forward slashes, although you do have to explicitly use the 'm' match operator if not using forward slashes (or question marks, see Regexp Quote-Like Operators in perlop) as the delimiter. Also, the forward slash is common to all of the paths so you could move it out of the alternation. The code becomes

grep ! m{^/(usr|sbin|platform|lib)$}, @files;

which to my eye is somewhat clearer!

I hope this helpful.

Cheers,

JohnGG