如何复制除Perl中所有隐藏文件之外的目录?

前端之家收集整理的这篇文章主要介绍了如何复制除Perl中所有隐藏文件之外的目录?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一个包含大量文件的目录层次结构.一些目录以…开头
我想在其他地方复制层次结构,省略所有以a开头的文件和目录.

怎么能这样做?

解决方法

我想你想要的是 File::Copy::Recursive的rcopy_glob():

rcopy_glob()

This function lets you specify a
pattern suitable for perl’s glob() as
the first argument. Subsequently each
path returned by perl’s glob() gets
rcopy()ied.

It returns and array whose items are
array refs that contain the return
value of each rcopy() call.

It forces behavior as if $File::Copy::Recursive::CPRFComp is true.

猜你在找的Perl相关文章