in reply to Reg Ex : an odd error...

I would suggest also cleaning up your code as follows:

foreach my $banned ( @bannedF ) { return BANNED if ( $folder eq $banned ); if( $mode == INC_SUBDIRS ) { $folder =~ /^($banned).*/; print "$_ out of $#bannedF - $banned - regex value: $1\n"; return BANNED if ($1); } }
I think it's much easier to read that way.

-----------------------------------
Frank Wiles <frank@wiles.org>
http://frank.wiles.org