gpt4 book ai didi

perl - <*> 在 Perl 中是什么意思?

转载 作者:行者123 更新时间:2023-12-04 13:26:34 27 4
gpt4 key购买 nike

在下面的代码中,<*> 到底是做什么的?命令做什么?

my @usbHddFileList = <*>;
foreach $usbHddFile (@usbHddFileList)
{
system("rm -f $curMountDir/$usbHddFile < /dev/null > /dev/null 2>&1");
}

最佳答案

这是一个 glob .根据 perlop :

If what's within the angle brackets is neither a filehandle nor a simple scalar variable containing a filehandle name, typeglob, or typeglob reference, it is interpreted as a filename pattern to be globbed, and either a list of filenames or the next filename in the list is returned, depending on context. This distinction is determined on syntactic grounds alone.

关于perl - <*> 在 Perl 中是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34421821/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com