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

标签 perl

我有一个包含一堆文件的目录层次结构。一些目录以 . 开头.
我想将层次结构复制到其他地方,省略所有以 . 开头的文件和目录。

怎么能这样呢?

最佳答案

我想你想要的是File::Copy::Recursivercopy_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 - 如何复制除 Perl 中所有隐藏文件之外的目录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2123744/

相关文章:

multithreading - 限制一次运行的线程数

regex - 使用 grep 查找匹配的字符串不会返回匹配的值

java - Informix CSDK 安装失败

Perl 更改调用者的工作目录

perl - 我怎样才能在 Perl 的路径中获得两个级别的目录?

PERL 如何跳过 while 循环中的错误

perl - 如何检测标准输出是否连接到 Perl 中的 tty?

linux - 创建一个ruser和user不同的进程

perl - 使用 Perl Test::More 时是否有函数名称约定?

arrays - 为什么map函数会改变perl中输入数组的值?