in reply to static storage in a local subroutine?
I think you probably want a lexical variable which is in a naked block which contains the function that manipulates the variable. Something like this:
{ my $count; sub manipulate_count { ++$count; print "manipulate_count has been called $count times\n"; } }
Update: Yeah. And what merlyn said below.
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: static storage in a local subroutine?
by merlyn (Sage) on Nov 23, 2005 at 14:51 UTC |