Custom scrip actions

What do the boxes “Custom condition” and "Custom action preparation code"
and “Custom action cleanup code” take as input? Is this raw perl code that
gets evaled? If so, can I use the usual RT ticket variables? (and aside to
that, is there some canonical location that I can see what information is
available to me?)