in reply to Re^2: Syntax Error deleting files and folders in a directory
in thread Syntax Error deleting files and folders in a directory

You know how troublesome it is when there are two (or more) people in the room with you who have the same name and you want to address only one of them? Well Perl has the same trouble with variables. You have introduced two array variables with the same name in the same room (for room read: lexical scope (set of {})) - kinda like having identical twins dressed and groomed the same with the same name in the room. Perl warns you about that, then just uses one of them completely ignoring the other.

Actually your whole script is still full of bugs. I'll let you go off and read the rest of the replies you got so you can fix some of them yourself. Come back if you don't get it sorted out.

BTW, a good technique that may save you a lot of grief is to comment out you rmtree code and use a print instead as a trial run to see what is going to be deleted when you reinstate the rmtree and run again.

True laziness is hard work

Replies are listed 'Best First'.
Re^4: Syntax Error deleting files and folders in a directory
by smturner1 (Sexton) on Dec 30, 2013 at 04:16 UTC

    There is no doubt that I need to go back to the drawing board. I am in the process of researching each aspect of the junky code I put up for scrutiny. Learning is and can be a very frustrating process, but my frustration is a good indicator of learning! :) Thanks for your help. I will republish this in a couple of days once I know I am closer to where I need to be. Thank you for your patience.