Is there a more effective way to use the rmtree to delete multiple directories other than using a while loopI'm a little confused by your question. Are you trying to remove directories, or just some files within a directory? If you are just trying to remove individual files that match the specified input pattern, you probably could use rmtree from File::Path to remove your list of files. But I believe the most customary usage of rmtree is to remove directories. Here is a quote from the documentation:
the rmtree function provides a convenient way to delete an entire directory subtree from the filesystem, much like the Unix command rm -r
It is probably more appropriate in your case to use unlink. You could replace your while loop with:
unlink @found_files;
In reply to Re^2: How to compare User Input to a file Name
by toolic
in thread How to compare User Input to a file Name
by rqatar2003
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |