sub make_var_hash{ my $xml = @_[0]; my %myhash; my $name; my $localname; my $defaultval; # #read the xml file extract the data and add to the following hash #UPDATE sorry this line should be $myhash{$name} = [$localname,$defaultval]; #NOT $myhash{$name} = ($localname,$defaultval); #end the loop return \%myhash; }