Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

[Re: Reg Ex : an odd error...] New Code

by Foggy Bottoms (Monk)
on Aug 20, 2003 at 12:48 UTC ( [id://285174]=note: print w/replies, xml ) Need Help??


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

Here's my latest code up-to-date cleaned-up and functional...

sub compareFolder { my $folder = shift; $folder = uc ($folder); while ($folder =~ /\\/) { $folder =~ s/\\/\//; # transform regular c:\sample\path into c:/ +sample/path for later comparison } my $mode = shift; my @wantedF = @{+shift}; my @bannedF = @{+shift}; for (0..$#wantedF) { return ACCEPTED if ($folder eq uc($wantedF[$_])); # if folder is + directly equal to a desired(forced) folder } for (0..$#bannedF) { return BANNED if ($folder eq uc($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 unless otherwise stated { my $bFolder = uc($bannedF[$_]); return BANNED if ($folder =~ /(^$bFolder\/).*/); # example : +$folder = c:\temp\one; $bannedF[$_] = c:\temp } } return ACCEPTED; # if execution reaches this point, then folder isn +'t affected by the forced/banned folder list # hence it can be scanned. }

Thanks for your help and insight...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://285174]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (7)
As of 2024-03-28 09:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found