It sounds like you're passing around a hash to various subroutines, when you want to pass a hash-reference. Passing a reference to a hash allows you to change the hash in a subroutine and have that change affect the rest of accesses to that hash.
As an example:
my %regular_hash = (
question1 => 'How are you?',
question2 => 'What is your name',
);
print $regular_hash{question1}; # prints 'How are you?'
change_question1(%regular_hash);
print $regular_hash{question1}; # still prints 'How are you?'
sub change_question1
{
my %regular_hash = @_;
$regular_hash{question1} = 'What is your mothers name?';
}
Now, if you were using a hash reference, you would be able to change the value:
my $hash_rev = { #notice the change of opening brace
question1 => 'How are you?',
question2 => 'What is your name',
}; # and the corresponding close
# and slightly different access methods
print $hash_ref->{question1}; # prints 'How are you?'
change_question1($hash_ref);
print $hash_ref->{question1}; # now prints 'What is your mothers name?
+'
sub change_question1
{
my $hash_ref = shift @_;
$hash_ref->{question1} = 'What is your mothers name?';
}
The difference is that Perl will pass its arguments by value, which means that it will create a copy of the data that you passed. However, when you pass a reference to a data-type, Perl passes the a memory location (similar to a pointer in C/C++). That memory location is a container for the values. So, when you change a value in the original container, it changes it everywhere.
If that's not what you're doing, perhaps the code you're working with would help.