Question 1: You cannot write to a file with the name of an existing directory. Possibly helpful could be an extention ".txt" to that file
Question 2: File::Find's subroutine is called for any single item while traversing the directory-tree. If you change the $file in the second if-block to $entry your code will run proper. But i think the result of scattered $dir.".txt"-files in the whole tree which are often empty will be not what you wanted.$dir=$entry . ".txt";
A good explanation how File::Find works could be found in spurperl's Beginners guide to File::Find
In reply to Re: Some problems with my code - Help...
by tos
in thread Some problems with my code - Help...
by star7
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |