in reply to integer operations

There's also the integer pragma. You don't want it in this case because it will throw away the 0.5 giving you 7, but I expect some other monks looking at this will find it useful:
$ perl -Minteger -e 'print 15/2' 7

Replies are listed 'Best First'.
Re^2: integer operations
by tphyahoo (Vicar) on Mar 01, 2005 at 10:30 UTC
    obvious but...
    perl -Minteger -e 'print 15/2 + 1'
    prints 8... or
    use strict; use warnings; my $eight = int (15 / 2 ) +1; print $eight;
      Untested:
      my @integers = 1..50000; print $integer[15/2];

      Yes, I'm just being silly. Also, this won't work for negative numbers. At all.