#!/usr/bin/perl use strict; use warnings; my $base = 0.0425; while ( my $line = ){ chomp $line; my ($z,$c1,$c2,$c3,$c4) = split(/,/,$line); print join("|",$z,$c1,$c2,$c3,$c4),"\n"; my $total = $c1+$c2+$c3; print $c4 == ($total + $base) ? "True\n" : "False $c4 != ".($total+$base)."\n"; } __DATA__ 00501,0.0000,0.0425,0.0025,0.0875 00544,0.0000,0.0425,0.0025,0.0875 06390,0.0000,0.0425,0.0025,0.0875