Call Perl script using appropriate operating system executable
result = perl(...)
[result, status] = perl(...)
perl('perlfile') calls the Perl script perlfile, using the appropriate operating system Perl executable. Perl is included with the MATLAB® software on Microsoft® Windows® systems, and thus MATLAB users can run user-created MATLAB functions containing the perl function. On Linux® and Macintosh systems, MATLAB calls the Perl interpreter available with the operating system.
It is sometimes beneficial to use Perl scripts instead of MATLAB code. The perl function allows you to run those scripts from MATLAB. Specific examples where you might choose to use a Perl script include:
Perl script already exists
Perl script preprocesses data quickly, formatting it in a way more easily read by MATLAB
Perl has features not supported by MATLAB
Given the Perl script, hello.pl:
$input = $ARGV; print "Hello $input.";
At the MATLAB command line, type:
ans = Hello World.