my regex flaw exposes another?

Kevin Buettner plug-discuss@lists.plug.phoenix.az.us
Wed, 6 Mar 2002 14:26:50 -0700


On Mar 6,  4:04pm, Mike wrote:
> [...] I was trying to exclude
> both the ".", "..", and a directory called "approved".
[...]

>   next if ($file =~ /(^\.)(approved)/);

Try:

    next if ($file =~ /^(\.\.?|approved)$/);

(Untested.)

Kevin