use Inline Java => <<'END_OF_JAVA_CODE' ; class Pod_alu { public Pod_alu(){ } public int add(int i, int j){ return i + j ; } } END_OF_JAVA_CODE my $alu = new Pod_alu() ; print($alu->add(9, 16) . "\n") ; if (fork == 0) { exit(0) } else { wait } print($alu->add(9, 16) . "\n") ;