Enumerate Ticket Custom Fields

In an external perl script, given a ticket object,
how would I enumerate the names and values of
the (queue-specific) custom fields attached to that ticket?

Many thanks for any pointers!

John
PS, I tried looking around the wiki, but I didn’t see anuthing relevant.