What I belive that anyone wants to say (but dont know why they havent said it that clearly) is that you cant use same pseudo code for both Perl and Pascal (or any other prog. languages).
These two languages are very different, and their logic is different.
If you do so, like in your case, you are not using strengths of the Perl. And I find it quite common that your code is much slower than one in pascal, as that pseudo code was probably writen with Pascal style programming on mind.
Shure, Perl (should not be that big problem in upcoming version 6 as it alows you to define type for a variable) is a bit slow with number crunching and lot's of loops.
Post the real problem, in english, and we will see what we can do.