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

Change your code to below and the output becomes:
0 out of 4 - c:/win32app/toolkit - regexp value : 1 out of 4 - c:/winnt - regexp value : 2 out of 4 - C:/WINNT/system32 - regexp value : 3 out of 4 - d:/perl - regexp value : 4 out of 4 - d:/brossad - regexp value :
I single qouted your directories and replaced you '\\' with / to avoid the unicode error
my @bannedF = ('c:/win32app/toolkit', 'c:/winnt', 'C:/WINNT/system32', 'd:/perl', 'd:/brossad'); my $folder = 'c:/TEMP/sdfs'; for (0..$#bannedF) { return BANNED if ($folder eq $bannedF[$_]); # if folder is directly equal to a banned folder if ($mode == INC_SUBDIRS) # if a parent folder is banned then so are the subfolders unle +ss otherwise stated { $folder =~ /^($bannedF[$_]).*/; print "$_ out of $#bannedF - $bannedF[$_] - regexp value : $1 +\n"; return BANNED if ($1); # example : $folder = c:\temp\one; $bannedF[$_] = c:\temp } }