Next Functional Programming in Perl 24

Syntactic Difficulties

        map { $_ * 2 + 1 } 1..10;
        sub imap {
          my ($f, $iterator) = @_;
          return sub {
            my $next = $iterator->();
            return defined($next) ? $f->($next) : undef;
          }
        }
        imap(sub { $_[0] * 2 + 1 }, $iterator);
        imap { $_ * 2 + 1 } $iterator;

Next Copyright 2005 M. J. Dominus