You might want to try IPC::Open3. You should be able to open the matlab executable thru the pipe, then print to it to load .m files. This is untested of course, and many executable won't work that way, but it's worth a try. Does matlab allow you to issue commands to it after it's running? Like "load myscript.m". If it does, you have a chance with running it thru a pipe with IPC. Read "perldoc perlipc".