In Perl, (courtesy of Hugo explaining what you mean by static variable :-)) you could have:
{
my $bumCount = 0;
sub bum {
$bumCount++;
warn "Bum has run $bumCount times\n";
}
}
... ie you create a 'bare block' {} around the subroutine to constrain the scope of $bumCount and ensure that it only gets initialised to 0 the first time the program is run, not for every invocation of the subroutine.
--
simon
|