If this is on a *nix system and you have read access to /etc/passwd (probably you're either root, or the system uses a shadow file) you could load it into an array and 'grep /^$uid/, @passwd_file_listing' then '$uuid = split /:/, @array_you_put_grep_output_into'...