It seems that what gave you an error message was "C:/Perl/lib/File/Find.pm line 593", to be more precise 'invalid top directory'.
What is your directory argument? Are you leaving it at $ENV{HOME} ? Is this environment variable even set on a windows system?
Add this to the first lines of code, before we instance File::Find::Rule..
(You can always bite the bullet and switch to linux. It takes about a year to get comfortable, if you're considering.)defined $ENV{HOME} or die("ENV HOME is not defined."); print STDERR " # env home is set at $ENV{HOME}\n"; -d $ENV{HOME} or die("ENV HOME is not a directory");
Furthermore, *DONT RUN THAT SCRIPT*, it's just an example script! :-)
Substitute $ENV{HOME} with something like 'C:\path\to\where\you\suspect\empty\files\reside'.
And *read* File::Find::Rule!
Don't give up so easily- if something does not work, that's when you start 'debugging'. Takes up most of my time, between tests (.t) and errors, and the fact that a third of my code is to check and recheck return values and results.. In the long run it's saved me a lot of sweat and blood.
In reply to Re^3: How to delete empty files
by leocharre
in thread How to delete empty files
by padawan_linuxero
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |