Please test code before you post. Ignoring the missing hash on your hash-bang line (#!/usr/bin/perl -w), the code if( $x =~ ($t[4]-$t[3]) > 70 * /100) { does not compile. Specfically, I get the error:
Search pattern not terminated at line 12.

As well, wrap input and output in <code> tags as well as source. This is important in this case because you are splitting on tabs, but your post does not contain tab characters. Read How do I post a question effectively?.

I am having a significant amount of difficulty understanding your spec. Assuming your first data are your input and the second are your output, the only filter I can find is that column 5 - column 4 > 217. The following code yields this result:

#!/usr/bin/perl -w #open (FILE,"$ARGV[0]") or die; my @temp =<DATA>; #close FILE; foreach (@temp){ my @t= split("\t",$_); # $t[2],"\n"; if( ($t[4]-$t[3]) > 217 ) { print "$_"; } } __DATA__ aa 22 310 1 300 ab 40 200 2 228 ac 51 230 10 241 df 23 240 22 242 ef 34 370 24 282 gh 24 125 22 210 df 76 290 11 232 wq 13 170 20 180 ss 89 288 12 270

Note this is fairly messy since I tried to use your posted code. I might have written something closer to

#!/usr/bin/perl use strict; use warnings; #open (my $fh, '<', $ARGV[0]) or die "Open failed: $!"; while (<DATA>){ my @values = split /\t/; if( ($values[4]-$values[3]) > 217 ) { print; } } __DATA__ aa 22 310 1 300 ab 40 200 2 228 ac 51 230 10 241 df 23 240 22 242 ef 34 370 24 282 gh 24 125 22 210 df 76 290 11 232 wq 13 170 20 180 ss 89 288 12 270

In reply to Re: to print l columnwise and subtraction by kennethk
in thread to print l columnwise and subtraction by vis1982

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.