Programatically altering custom fields

How is one supposed to use the undocumented

Based on instances of use in RT I’ve tried the following,
but it does not seem to work; though it reports no errors.

    my $ticket = new RT::Ticket($session{'CurrentUser'});
    push @results, ProcessObjectCustomFieldUpdates( ARGSRef =>{
      '['. $val
    }, Object => $ticket );

This is in a modified copy of Admin/Users/Modify.html after the call to create,
and is meant to replace the value of the CF in the referring ticket
(passed in as
$refid via the Wikitext patch for placeholders) with a link to
view/modify the newly
created user.

Cambridge Energy Alliance: Save money & the planet