Foggy Bottoms has asked for the wisdom of the Perl Monks concerning the following question:
for (0..$#bannedF) { return BANNED if ($folder eq $bannedF[$_]); # if folder is dir +ectly equal to a banned folder if ($mode == INC_SUBDIRS) # if a parent folder is banned then so + are the subfolders unless otherwise stated { $folder =~ /^($bannedF[$_]).*/; print "$_ out of $#bannedF - $bannedF[$_] - regexp value : $1 +\n"; return BANNED if ($1); # example : $folder = c:\temp\one; $ba +nnedF[$_] = c:\temp } }
@bannedF = ("c:\\win32app\\toolkit", "c:\\winnt", "C:\\WINNT\\system32", "d:\\perl", "d:\\brossad"); my $folder = "c:\TEMP\sdfs";
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 : Can't find unicode character property definition via main->e or e.pl a +t unicode/Is/e.pl line 0 Press any key to continue . . .
Heureux qui, comme Ulysse, a fait un beau voyage
Ou comme celui-là qui conquit la Toison,
Et puis est retourné plein d'usage et raison,
Vivre entre ses parents le reste de son âge!
J. du Bellay, poète angevin
Edit by tye, change PRE to CODE around long lines
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Reg Ex : an odd error...
by Abigail-II (Bishop) on Aug 19, 2003 at 15:03 UTC | |
|
Re: Reg Ex : an odd error...
by bear0053 (Hermit) on Aug 19, 2003 at 15:00 UTC | |
|
Re: Reg Ex : an odd error...
by ides (Deacon) on Aug 19, 2003 at 15:05 UTC | |
|
Re: Reg Ex : an odd error...
by Not_a_Number (Prior) on Aug 19, 2003 at 20:25 UTC | |
by Foggy Bottoms (Monk) on Aug 20, 2003 at 08:04 UTC | |
by Foggy Bottoms (Monk) on Aug 20, 2003 at 12:48 UTC | |
|
Re: Reg Ex : an odd error...
by Jasper (Chaplain) on Aug 19, 2003 at 15:07 UTC | |
|
Re: Reg Ex : an odd error...
by tcf22 (Priest) on Aug 19, 2003 at 15:06 UTC | |
|
Re: Reg Ex : an odd error...
by banduwgs (Beadle) on Aug 19, 2003 at 15:04 UTC |