I hoped that what I was doing was clear enough. The real improvements were doing a chomp() on the whole list at once, only once, removing any empty elements, then pre-compiling all the patterns.
I also changed your for ( ... ) { unless ( ... ) { ...; last } } because it read strangely for me. unless() is like that, sometimes it just reads strangely. Since the intent of that code was to be an "everything matches or I print the file name" I just skipped right to the next pattern if there was a match and made the exception stand out.
In reply to Re: Re: Re: Help with null string behavior in regex?
by diotalevi
in thread Help with null string behavior in regex?
by McMahon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |