Perl 5.10 added a new class of variables ‘state’ that are similar to ‘my’ in scope but are only initialized once. Even inside of a subroutine a state variable will only be initialized on the first call to the subroutine and will maintain it’s last value between calls. A simple example is the easiest [...]