gpt4 book ai didi

linux - Perl + Linux 在多个文本位置重新排列列

转载 作者:太空宇宙 更新时间:2023-11-04 05:40:37 26 4
gpt4 key购买 nike

#!/usr/bin/perl

use strict;
use warnings;

my $file;
my @files;
my $parse;
my @files = <*>;
foreach $file(@files)
chomp ($file);
{
$parse = system qq(paste <(cut -f1,2,13 $file) <(cut -f12 $file));
}
<小时/>
"my" variable @files masks earlier declaration in same scope at Rast_seq.pl line 11.
sh: 1: Syntax error: "(" unexpected
sh: 1: Syntax error: "(" unexpected
sh: 1: Syntax error: "(" unexpected
sh: 1: Syntax error: "(" unexpected
sh: 1: Syntax error: "(" unexpected
sh: 1: Syntax error: "(" unexpected

请帮我解决这个错误。

最佳答案

将左大括号 { 移到 chomp;
之前并删除第一个 my @files;
并更改 qq

的分隔符
my $file;
my $parse;
my @files = <*>;

foreach $file(@files) {
chomp ($file);
$parse = system qq#paste <(cut -f1,2,13 $file) <(cut -f12 $file)#;
}

关于linux - Perl + Linux 在多个文本位置重新排列列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15474091/

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