在Windows7上找不到File::FindRaku
我有一个非常简单的程序,它列出.txt了给定目录中的所有文件。这个程序在我的 Mac 上完美运行,它有 Rakudo Star 版本 2019.03.1
use File::Find;
my $folder="../Documents";
.say for find dir => $folder, name => /'.txt' $/;
当我尝试在具有 Raku 2020.12.1 的 Windows 7 上运行相同的程序时,它给出了以下信息:
use File::Find;
my $folder="../Documents";
.say for find dir => $folder, name => /'.txt' $/;
我已经将 Raku 更新到 Raku 2021.02.1 版本,并且再次出现相同的错误。我已经通过解压缩rakudo-moar-2021.02.1-01-win-x86_64-msvc.zipie安装了它,而没有使用任何安装程序。而关于Mac上的Raku,我不记得安装了File::Find模块,也不知道如何列出已安装的模块,即我没有检查是否File::Find安装在Mac或Windows 7上。
如何使该程序在 Windows 7 上运行?
回答
File::Find未内置于乐堂或随乐堂之星分发;据我所知,从来没有。
它是生态系统中的一个模块,您可以使用 Zef 安装(使用命令zef install File::Find)。
它也是一个很短的图书馆。如果您有兴趣在不添加依赖项的情况下修复您的脚本,您可能需要查看File::Find;的源代码;它足够短,您可以轻松地自己实现相同的功能。
- @LarsMalmsteen it may be that zef installed while installing some other module. It will automatically install dependencies for you.