I've found an "old" post (Jan 2007) on the Trillian Forums about a Trillian 2.x plugin called TrillPerl. Supposedly it works with 3.1 as well, but is real flaky in Astra.
Keep Contact Statistics [Archive] - Trillian Discussion Forums A quick google search led me to
TrillPerl development site where you can download the plugin.
While I do not know if Trillian Astra has a 'command-line' version i'm sure that Pidgin has a text-based ncurses interface called
finch.
Pidgin also supports Perl scripts without the need of 'plugins'/modules.
Scripting and Plugins - Pidgin - Trac is a FAQ page that has links that help you with setting up your Perl scripts.
If you really want to write a robot i suggest you forget Trillian and Pidgin. They are too feature rich to run smoothly as robots (IMHO).
Pork (which only connects to AIM and IRC) is probably a better solution for writing robots. It supports Perl scripts.