#!perl use strict;use warnings; my $fmt = "%1.5f"; # set 5 decimal places while(){ chomp; (my $dividend, my $divisor) = split(/\s+/,$_,2); (my $int, my $frac) = split(/\./, (sprintf($fmt, ($dividend/$divisor))),2); print "Integer part: $int\tFractional part: $frac\n"; } __DATA__ 1 2 2 1 3 4 4 3 127 5 75 5