in reply to hash ref is empty inside subroutine

Further to tobyink's post: Here's one scenario (of many) in which hash data can 'vanish' in certain circumstances, only to magically reappear later:

>perl -wMstrict -le "my $hr = { 'Node' => 'TestServer' }; my ($k) = each %$hr; print qq{'$k'}; ;; pk($hr); ;; sub pk { my ($hr) = @_; my ($k) = each %$hr; print qq{'$k'} } " 'Node' Use of uninitialized value $k in concatenation (.) or string at -e lin +e 1. ''

Now try inserting an otherwise-useless keys statement after the first each statement (which exhausts hash iteration in this case):
    my ($k) = each %$hr;
    my $ignore_this = keys %$hr;

>perl -wMstrict -le "my $hr = { 'Node' => 'TestServer' }; my ($k) = each %$hr; my $ignore_this = keys %$hr; print qq{'$k'}; ;; pk($hr); ;; sub pk { my ($hr) = @_; my ($k) = each %$hr; print qq{'$k'} } " 'Node' 'Node'

See each and keys (and values) for discussions of hash iteration behavior.

Update: neousr: Others have alluded to the annoying fact that you show no (useful) code. What would really be useful would be a small, standalone, executable code example demonstrating the problem. The effort to produce such code may not be trivial, but the very process of producing it may clarify the problem so far as to answer your own question!