#!/usr/bin/perl use strict; use warnings; sub create_iter { my $i = 0; my $inc = shift; return sub { $i+=$inc; return $i } } my $iter = &create_iter(50); print &$iter, ' ' for (1..20); print "\n"; exit;