You run other programs from within java using a newProcess command
System.newProcess(<name of perl script>);
the name of that method might be off, I'd check the System API first
I do agree with the previous post though, you most likely are using javascript, rather than JSP
The above only works for java (in a web services case, JSP).
Greetings.