refactor PerlSourceGenerator
refactor old code
remove javac warnings