16
Sleep is a scripting language with an interpreter that runs in the JVM. From what I understand the Sleep language is basically Perl with some extensions. Your code may be able to run in Sleep. If it does you can instantiate the interpreter, run the code and retrieve the result.
Guess it really depends on what your perl code is, and what you're trying to do..
If just using exec() is too simple, something like gearman could be helpful