my (%machines, %states); sub new { my $class = shift; my $self = bless {}, $class; my $fsa = $machines{$self} = { done => undef, notes => {}, stack => [], table => {}, self => $self, }; $def->{name} = $state; $def->{machine} = $self; $fsa->{table}{$state} = $obj; push @{$fsa->{ord}}, $obj; $states{$obj} = $def;