in reply to caching hashrefs in state

I tend to roll even small scripts into a module. And set needed values as module attributes. These of course persist across methods. And they are only initiated once.

my $self = shift; $self{attr_name} = your_data_structure;