You have
... if $data->{ Name } = '';. This will always end up assigning $data->{Name} to the empty string (because
= is an
assignment operator not an
equality operator); and since the empty string is false, the expression evaluates to false, so the
if sees false, so the push will never happen.
String comparison is done with the eq operator, so you probably want ... if $data->{ Name } eq '';
edit: rereading your question, that might not be all of what you need; I'm not sure I understand it fully. However, the assignment operator does need to be changed to the string equality operator to make that if clause make sense.