in reply to Re^3: static storage in a local subroutine?
in thread static storage in a local subroutine?
so I was seeing get_count() should be defined repeatedly.sub test{ { my $cnt = 1; sub get_count { return $cnt++; } } print get_count(); } print "test 4: ".test(4)."\n"; print "test 7: ".test(7)."\n";
|
|---|