in reply to Automatic creation of hash elements

You can check if a key exists or is defined without creating it. You could insert that into your test like so:

if ( exists $CATEGORY_DATA{$FD_NAME} && $FD_NAME eq $CATEGORY_DATA{$FD_NAME}{'FIELD_NAME'} )

You could also only loop over the keys of your hash in the first place.

foreach my $FD_NAME ( keys %CATEGORY_DATA )