For now, you use scope to accomplish this:
{ my $cnt = 1; sub get_count { return $cnt++; } } print get_count(), "\n" for 1..10;
Cheers - L~R
In reply to Re: static storage in a local subroutine?
by Limbic~Region
in thread static storage in a local subroutine?
by Moron
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |