On Fri, 2007-07-20 at 08:36 +0200, Mike wrote:
> > > if ($f =~ m|\.c$|) { <---------------- Here, bad coder! BAD!
> > I don't know perl at all, so those were
> > stabs in the dark. Any pointers on that would be appreciated.
> Try:
> if( $f =~ m/\.c$|\.cpp$|\.cc$/ )
> Kind regards.
I'd go for:
if ( $f = ~m/\.c(c|pp){0,1}$/i )
This variant avoids backtracking and makes the regexp case insensitive.
Yes, it does accept monsters like 'Foo.cPp'. but who cares :-)
Cheers, RalfD
BTW - did anyone report this bug to the maintainers?