sub generateSequencer { my( $start, $inc )= @_; $start -= $inc; return sub { return $start += $inc; }; } my $countByTwos= generateSequencer( 0, 2 ); print $countByTwos->(), $/ for 1..3; my $countByThrees= generateSequencer( 1, 3 ); print $countByTwos->(), " ", $countByThrees->(), $/ for 1..4;