in reply to accessing EJB from perl
You may want to see if JPL/JNI does what you need. I've only played around with it, but it seemed to work fine. The best part of JPL/JNI is that they are part of perl's core. Here's a good tutorial to help you get started with integrating Java and perl.
In Section
Seekers of Perl Wisdom