#!/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/