- or download this
#file state.pl
sub foo {
...
foo called 4 times
foo called 5 times
foo called 6 times
- or download this
# file state.pl
my $cond;
...
array @bar = (4)
array @bar = (5)
array @bar = (6)
- or download this
use feature qw(state);
# also
...
state @bar;
...
}