in reply to Why not perl have raw/native type

If "frustratingly the program in Perl is still slow," it is unlikely that the true cause of it is dynamic data types. Profile your code to find out where and what the slowdown actually is. Do not assume. As Kernighan and Plauger said, "don't 'diddle' code to make it faster find a better algorithm."