in reply to Re^2: How to correctly use a symbolic reference to automatically generate hash names?
in thread How to correctly use a symbolic reference to automatically generate hash names?

Why on earth would you have %wow1, %wow2, and %wow3, instead of %{$wow[1]}, %{$wow[2]}, and %{$wow[3]}? In other words, instead of:

%wow1 = ( key => value, key => value ); %wow2 = ( key => value, key => value );

You could have...

@wow = ( { key => value, key => value }, { key => value, key => value }, );

Which is an array of hashes, instead of a bunch of hashes loosely related by naming convention.

I see no advantage to polluting your package global namespace with variable names that are tricky to manipulate when you could just create a single AoH structure.


Dave