in reply to static storage in a local subroutine?
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: static storage in a local subroutine?
by merlyn (Sage) on Nov 23, 2005 at 14:49 UTC | |
by Limbic~Region (Chancellor) on Nov 23, 2005 at 14:56 UTC | |
|
Re^2: static storage in a local subroutine?
by jeffguy (Sexton) on Nov 23, 2005 at 13:52 UTC | |
by Limbic~Region (Chancellor) on Nov 23, 2005 at 14:02 UTC | |
by jeffguy (Sexton) on Nov 23, 2005 at 14:52 UTC | |
by dave_the_m (Monsignor) on Nov 23, 2005 at 14:08 UTC |