So, you're new to Perl, and for your first non-trivial program you wrote, you ended up with a solution that's slower than a Java implementation you did. I presume you aren't as new to Java as to Perl.
Don't you think that's a very small bases to conclude Java is faster than Perl?