@printrows = $newhash{$key}; # wrong -> the hash will contain a reference to an array @printrows = @{$newhash{$key}}; # right -> de-reference the array first