---------------------------- Why this control fails?
while (my $name=readdir OF) {
next if ( ($name =~ /^\./ )||(-f $name) );
That fails because you are testing the file name in the current directory instead of the $oldFolder directory.
the control on ".",".." is correct
Wrong: next if $name =~ /^\./ will match any name that starts with '.', not just "." and "..".
In reply to Re: check if it is a file or directory
by jwkrahn
in thread check if it is a file or directory
by saintex
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |