Your [tt]$VAR1,[/tt] etc are not hash elements, so I'm not sure to understand what you mean. Also you can have only a single empty key value in a hash, corresponding to the string of zero length [tt]''[/tt]. This is easy to delete with
[tt]for(keys%hash{delete$hash{$_}unless$_}[/tt]
Note however that this will also delete the key '0'!
I can't see at the moment a generalized method for detecting whether a hash value is 'empty' as you say, as it depends on what you mean by empty. This
[tt]for(keys%hash{delete$hash{$_}unless$hash{$_}}[/tt]
will delete all values corresponding to false, that is the undefined scalar, a string of zero length, the string (or number) '0' (though not the string '00') and possibly a few others. However if, as in your example, you have references to arrays or hashes with zero elements, these will not be deleted, in this case you should test against the number of elements in them. There are also a few other cases to consider: references to subs, possibly elements defined through constants, and...?
Franco
: Online engineering calculations
: Magnetic brakes for fun rides
: Air bearing pads