How to access User custom fields in code?

I am trying to figure out how to write / read custom fields for users.
I see there are some functions related to custom fields in, and but
there isn’t something specific for users.

Was ObjectCustomField created as a more generic form of custom fields?

A pointer in the right direction or a snippet of code would be greatly

Here is something I started with. It is code I have to extract the
value from a particular ticket custom field:

my $CustomFields = $Ticket->CustomFields;
while (my $CustomField = $CustomFields->Next()) {
    if ($CustomField->Name eq 'FOOid') {
        my $Values = $Ticket>CustomFieldValues($CustomField->Id);  
        my $Value = $Values->Next();
        $FOOid = $Value->Content if defined $Value;

Note: This doesn’t seem all that efficient or elegant, but it is how I
got it to work. Recommendations for better methods are always


Trask Rogers
Technical Support Engineer
Lyris Technologies, Inc.