perl根据下一行输出上一行的代码,供大家学习参考。
#!/usr/bin/perl
use warnings;
use strict;
open(ONE,"$ARGV[0]") or die $!;
my (%h, $x, $y,$key1,$key2);
my @a;
my @b;
while (<ONE>) {
if (/EntrezGene/){
$key1=$_;
}else{
$key2=$_;
}
print "$key2$key1" if /EntrezGene/;
}