in reply to next if regex matches

The square brackets are unnecessary. next unless $path =~ /\.(log|txt)$/;You could also be a little more parsimonious: next unless $path =~ /\.(?:log|txt)$/;Thus avoiding a (presumably unnecessary) capture to $1.

The square brackets are also what made your post render weird. ;-)

Replies are listed 'Best First'.
Re: Re: next if regex matches
by Anonymous Monk on May 14, 2003 at 20:49 UTC
    This worked exactly as needed! Thanks
Re: Re: next if regex matches
by tos (Deacon) on May 15, 2003 at 11:13 UTC
    another form of negation could be
    next if $path !~ /\.(?:log|txt)$/;
      Sorry monks.

      To late i noticed that Enlil already mentioned my comment. So i'll go up to my room and flagelate myself.