in reply to Retunining hash values from subroutines
In addition to bart's comments, you define %UID_PATH three times:
Keep only the second.