in reply to Does inner hash/key exist?

pfaut already answered your question, but when you have to grep through arrays to determine existance, you almost always should be using a hash and the exists function. Even if you need to keep them in the order that they were found, you can use your array in conjunction with a separate hash (or hash of hashes in your case):
push {@{$failed{$client}}, $sid unless exists $fail{$client}{$sid}; $fail{$client}{$sid} = undef;
Or just do the second statement if you don't need to keep the keys in order, then it doesn't matter if it exists already.