I find it easy in perl to do things such as:
print "File not found, valid files are:\n\n".`ls DIRECTORY | grep 'php'`;
`rm -rf directory`
my @files_list = split("\n", `ls DIRECTORY | grep 'FILE_NAME_REGEX'`)
Is it bad practice to do such things? I find it so much easier to do this than painstakingly implement every thing. I treat Perl as an advanced version of bash.
Using external binaries is:
In this particular case, look at the
File::Globmodule.