in reply to check if it is a file or directory
---------------------------- 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 "..".
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: check if it is a file or directory
by saintex (Scribe) on Feb 26, 2010 at 15:11 UTC |