I suppose it would be possible to have your java program act as a "main" method, call down into JNI, and from JNI embed a perl interpreter which would (by various function calls) manipulate the Java code while in JNI land (JNI allows for all sorts of Java language abuses, including private variable access). JNI ain't fun though, nor is embedding an interpreter.