- or download this
use v5.30;
use strict;
...
counter();
say "getter => ", getter();
- or download this
use v5.30;
use strict;
...
my $got = counter();
say "got => ", $got;
- or download this
{
my $foo = 123;
...
...;
}
}
- or download this
sub myfunc {
state $foo = 123;
...;
}
- or download this
{
my $foo;
...
...;
}
}