#! perl -slw use strict; use Math::BigInt; use Time::HiRes qw[ time ]; use feature qw(say); my $start = time; my $bn = Math::BigInt->bfac( 1000 ); my %result; $result{ 1000 } = $bn->bstr; for( 1001..2000 ) { $bn *= $_; $result{ $_ } = $bn->bstr; } my $end = time; printf "Took %.6f seconds\n", $end - $start;