# First make the program know the two numbers: $Number1 = 48; $Number2 = 12; # Now divide the numbers: $Result = $Number1 / $Number2; # ...and look if we got a decimal: #### # Using your sub is_integer_string($Result) # Look for a . $Result =~ /\./; # Check if the number is the same as its integer part: $Result == int($Result) #### if (condition) { print "Yes"; } else { print "No"; } #### sub is_integer_string { my $N = $_[0] + 0; return $N =~ /^\-?\d+$/; }