in reply to Perl to Java

Seems to me you have a Java problem, not a Perl one.