Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试打开与我正在运行的程序位于同一目录中的文件。
我不想指定要读取的文件的确切名称,而是希望能够匹配以“output.2.txt”结尾的任何文件名。像这样的东西(但这不起作用):
if ($input == 2) { my $seqs =~ m/output.2.txt/; open $genes, '<', $seqs or die "Can't open '$seqs'"; }
用于glob展开文件名列表:
glob
my @filenames = glob ("*output.2.txt");