Help for this page

Select Code to Download


  1. or download this
    sub upto {
       my ( $m, $n ) = @_;
    ...
          return $m++;
       };
    }
    
  2. or download this
    sub upto {
       my ( $m, $n ) = @_;
       return sub { $m <= $n ? $m++ : () };
    }
    
  3. or download this
    my $iter = upto( -2, 2 );
    
    while ( my ( $ele ) = $iter->() ) { 
       say $ele;
    }
    
  4. or download this
    -2
    -1
    0
    1
    2
    
  5. or download this
    sub list {
       my @a = @_;
    ...
    while ( my ( $ele ) = $iter->() ) ) { 
       say $ele // "[undef]";
    }
    
  6. or download this
    1
    0
    [undef]
    a