in reply to New Jersey Lottery Probability

Here's my redesign. You're reassigning (50*49), (49*48), (48*47)... to $probability every time through the loop.
#!/usr/bin/perl -w use strict; # use integer; my $probability = permutation(50,5); print ($probability * 36); sub permutation { my $probability = 1; my ($number, $times) = @_; print "The times is $times and the number is $number.\n"; while ($times-- > 0) { $probability *= $number; $number--; } return $probability; }
Commenting out 'use integer' does slow it down. In its defense, it does avoid a type overflow which gave me an incorrect result of 563108608.

For what it's worth, I have a different type of lottery script generating data at my homepage. I can post it, as it might be interesting.