From: Todd Welti on
Is it possible to return a variable from a Matlab call to a perl script?

I am not a per programmer, but tried adding

return 0;

to the end of the hello.pl examplt script (from Matlab documentation) and called it:

a = perl('hello.pl','World')

But I get error in perl.m

??? Error using ==> perl at 82
System error: Can't return outside a subroutine at hello.pl line 7.
Hello World.Command executed: perl hello.pl World