Perhaps you could do this using remote java debugging in Eclipse .
Your perl script should launch a java application with parameters to enable remote debugging in the JVM, for example
-Xdebug -Xrunjdwp:transport=dt_socket,address=8001,server=y,suspend=y
You then instruct Eclipse to connect to this JVM by creating a debug remote Java application configuration that indicates the correct host / port.
source share