I'm running the following code and keep on getting an annoying error I've no idea what's causing it... Has anyone seen anything similar before ? Regexes aren't my cup of tea and I reckon I miswrote the one I'm using but as you'll notice in the example below, it works fine for 2 strings before failing...
Here's the code :
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
}
}
And here's the value of the variables...
@bannedF = ("c:\\win32app\\toolkit",
"c:\\winnt",
"C:\\WINNT\\system32",
"d:\\perl",
"d:\\brossad");
my $folder = "c:\TEMP\sdfs";
Here's the output...
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 . . .
Thanks everyone for your help...
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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.