in reply to New Folders

If "$path.1" doesn't exist, $New is never changed as the changing line is inside the until {} loop

By the way, using uppercase, lowercase and mixed variable names together like $path and $PATH and $New is a sure way to put additional bugs into your code. Or do you have a special system that avoids confusion?

Replies are listed 'Best First'.
Re^2: New Folders
by Brian268 (Novice) on Dec 15, 2011 at 12:30 UTC

    Thanx Moving $New = qq($PATH\\$nFile); out side the loop worked doesn’t explain why it worked on the second run and not the first.

    No I don't have a special code for naming just that’s the way I’ve all ways done it. I agree $PATH and $path is confusing. May be I should of used $Tpath inside the loop

      ...doesn’t explain why it worked on the second run...

      Oh, it does. On the second run the directory $path.1 had already been created (by the first run) and so the loop beginning with "until (! -d $PATH)" did run at least once. When that happens the line "$New=..:" gets executed. Result: $New!=$Old