my $fact = create_iter (<<'EOS' return sub { $rest[0]++; $rest[1] *= $rest[0];}; EOS , 1, 1); print "\n\nFact: \n"; print $fact->(), " ", for 1..5;