Hello Monks!

After the recent problem got solved: elseif syntax error. (Removing spaces in path and filenames recursively ...)
There seems to be a need for me to built some security features for not nuking my systems ...
If the code would be run on mounted server shares with applications it is harmful even so if run on (German path) "C:\Dokumente und Einstellungen\"
cause it would break application paths (I wonder why programmers use paths with spaces but thats another story ...). So i wonder how i could do this:
cwd to determine the current directory? http://perldoc.perl.org/Cwd.html something like:?  pseudocode: If path contains: (pattern1 | pattern2 | pattern3) die

where pattern1="C:\dokumente und Einstellungen" pattern2=apps, pattern3=my_very_important_path. Should i use an array for this? Or i wonder if it would be best to look for the contents of the directory first and see if it contains files with:
an .exe .dll ...
leave it alone?. If you would be so kind to give me a hint in which direction i should develop the solution?

Thanks in Advance MH

In reply to Test for directory entries and exit if certain conditions are met? by matze77

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.