Multithreading – is calling binaries such as LS or RM a bad Perl exercise?

I find Perl easy to do the following:

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 these things? I think it's much easier to do this than to take pains to implement everything I see Perl as an advanced version of bash

Solution

The external binaries used are:

>Very inefficient > probably unsafe > not portable (thx @ friedo) > lazy... In most cases, there is a Perl module. If you look for it, it will do what you want

In this special case, please check the file:: globe module

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>