use bigint; while(<>) { my ($a, $b)= map { 0+$_ } split/ /; print $a - $b, "\n"; }