in reply to Problem with passing hashes between modules

I modified you subroutine 'PassMe' so that only references to a hash are pushed into the array @data. (I named it 'other_hash', but you should definitely rename it!). This should ease the maintenance.
sub passMe { my @data = (); my %other_hash = ( position => 'annotations', sid => $sid, navigator_link => '<a id="expand_nav" onclick="Element.hide(\'expand_nav\');"> +[brief]</a>', annotations_detail_link => q|[<a id="sed" onclick="Element.hide('sed'); Element.show('h +ed'); show_experiment_details();"> experiment details</a>]|, template => $tmpl ); push( @data, { \%params, \%extend_params, \%basics, \%annotations, \%navigator, \%other_hash } ); return \@data, $ID; }

Replies are listed 'Best First'.
Re^2: Problem with passing hashes between modules
by Fletch (Bishop) on Mar 05, 2008 at 16:21 UTC

    Erm, so you've now given him a hashref which contains a reference to %extend_params keyed by the stringified reference to %params, a reference to %annotations keyed by the stringified ref to %basics, and likewise for the last two elements.

    Can you share what color the sky is on your planet where that's a useful data structure?

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.