poj#!/usr/bin/perl use warnings; use strict; my $prev_l; my $prev_p; my $count = 0; ### add while(<>){ my $hitlength; my $prevalence; my $line = $_; chomp $line; if ($line =~ /^[\d]/){ my @hitline = split(/,/ , $line); $hitlength = $hitline[4]; $prevalence = $hitline[65]; if( ($count++) and ($hitlength == $prev_l) and ($prevalence == $prev_p) ){ next; } else { print "$line\n"; } $prev_l = $hitlength; $prev_p = $prevalence; } }
In reply to Re: How to Save a variable outside of a loop
by poj
in thread How to Save a variable outside of a loop
by Calebros
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |