in reply to Hashes of Arrays of Hashes (sometimes of Arrays)
Perl provides help for getting at the intermediate level with references, so you only deal with the level you're focusing on, but when you assign to a variable, you're changing it in the larger structure. Giving names to the intermediate levels lets you explain what's going on at that level. I don't know what you're working with, but one might change
to someting like$widget{'bars'}[0]{'bar1'} = $mw->Entry( -textvariable => \$hash{'bars +'}[0]{'bar1'} ) ;
Often this is more clear and consice than jumping to an OO approach just to give names for intermediate levels.$widget_current_bar = \$widget{'bars'}[0]{'bar1'}; $source_current_bar = \$hash{'bars'}[0]{'bar1'}; $$source_current_bar = $mw->Entry( -textvariable => $source_current_ba +r)
You may need an OO approach for other reasons, and the syntactic overhead for handling inheritance that an OO approach brings along may be justified on that basis, but it's important to have techniques for managing structures in any case. You may need them within your methods.
|
|---|