#!/usr/bin/perl use strict; use warnings; # will print 6.25 # not like C, division is done in floating point by default my $result = 25 / 4; print "25 / 4 = $result\n"; # will print 1 # modulus operator still works like C my $modulo = 25 % 4; print "25 % 4 = $modulo\n"; # force integer division as expected in C to return 6 use integer; my $result = 25 / 4; print "25 / 4 = $result\n";