sub divmod { use integer; my ($a, $b) = @_; my $tmp = $a / $b; ($tmp, $a - ($b * $tmp) ); } $a = 13; $b = 2; print divmod($a, $b);