tokuhirom
8/28/2009 - 8:28 AM

bar.pl

use strict;
use Perl6::Say;

sub counter {
    my $out if 0;
    return $out++;
}

say counter();
say counter();
say counter();
say counter();
say counter();

use strict;
use Perl6::Say;

{
    my $i;
    sub counter {
        return $i++;
    }
}

say counter();
say counter();
say counter();
say counter();
say counter();