Hi, i suggest that i am expirenced in Perl and other things :) As I understood your task, you have problem with calling perl subroutine from EXIM config file.
Please notice that correct syntax is ${perl{foo}} ( $- is mandatory), your description doesn't contain this. I hope this helps you.