in reply to matlab to perl
Why are you trying to do this in the first place? You seem to have a functioning application in MatLab and you want to mess with it by moving it to perl. If it is a case that you don't want to spend money on more MatLab licences, then just use Octave. Octave runs Matlab code directly.
It's nothing against perl, I'm sure it can do it. But it might not be the most productive time spent.