if (%hash) { ..do something for a filled %hash... } else { ...do something for an empty %hash... }