in reply to Directory recursion on win32

Your recursion code is ok - you have to specify the path for "rename":

rename( $PWD . "\\" . $DirItem, $PWD . "\\" . $Formatted );

Replies are listed 'Best First'.
Re: Re: Directory recursion on win32
by fourmi (Scribe) on Aug 04, 2003 at 15:45 UTC
    Ahh, okay that has gained me an extra level of recursion. Can i get confirmation that $PWD will take on the new pwd on each recursion not, maintain the previous value? (i'm not fully understanding the practical differences between $def, my $def, and my ($def) )
      sub Recurse { my ($PWD) = @_;

      This makes $PWD exist only during this call to this block. Recurrent calls will create new versions of $PWD.

      The parenthesis make a list, and $PWD is the first value. This list gets aliased to the values in the @_ list, such that $PWD = $_[0].