One way is to just use redirection and run you program from the command line: program >> output.txt.
Another way would be to change your print statement such that it outputs to your file handle: print(OUT "$name\n");
Yet another way is to make the OUT filehandle the default using select immediately before you call File::Find::find().
Take your pick
In reply to Re: Write output of File::Find::find({wanted => \&wanted}, to a file?
by duff
in thread Write output of File::Find::find({wanted => \&wanted}, to a file?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |