in reply to to print l columnwise and subtraction
If I understand you correctly, you want to compare the difference of each line with 70% of the value of the *first line* third column value. If that is the case, simply do this:
my $minvalue; foreach (@temp){ my @t= split("\t",$_); $minvalue= $t[2] if (not defined $minvalue); if( $x =~ ($t[4]-$t[3]) > 70 * $minvalue/100) { ...
This method works whether you have the whole file in memory or are reading it line by line from a file.
Note that you can move the calculation of the 70% to the line where you initialize $minvalue, so that it is calculated once instead of every time through the loop.
|
|---|