An integer is a positive or negative whole number. Examples of positive integers are 1, 2, 3, and 4. Examples of negative integers are -1, -2, -3, and -4. The number 0 is also considered an integer even though it has neither a positive or negative value. In most programming languages, you can convert a number into an integer using the int function.
The int function in Perl
my $random = int(rand(10)); print "Random number between 0 and 10: $random\n";