yueli711 has asked for the wisdom of the Perl Monks concerning the following question:
Hello, I just want to the number of the first column to minus the second column. The results are all 0. Thanks in advance!
open(IN1,"tmp01") || die "Cannot open this file"; @lines1 = <IN1>; open(OUT,">tmp02") || die "Cannot open this file"; for $item1(@lines1){ chomp $item1; @tmp1=split(/t+\,$item1/); $a=$tmp1[1]-$tmp1[0]; print OUT $a,"\n"; } close(IN1); close(OUT);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: wrong in minus
by AnomalousMonk (Archbishop) on May 10, 2018 at 18:08 UTC | |
|
Re: wrong in minus
by Anonymous Monk on May 10, 2018 at 16:54 UTC | |
by Tux (Canon) on May 10, 2018 at 17:16 UTC | |
by yueli711 (Sexton) on May 10, 2018 at 19:09 UTC |