| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
perl('perlfile')
perl('perlfile',arg1,arg2,...)
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 M-files containing the perl function. On UNIX [1] systems, MATLAB calls the Perl interpreter available with the operating system.
perl('perlfile',arg1,arg2,...) calls the Perl script perlfile, using the appropriate operating system Perl executable, and passes the arguments arg1, arg2, and so on, to perlfile.
result = perl(...) returns the results of attempted Perl call to result.
[result, status] = perl(...) returns the results of attempted Perl call to result and its exit status to status.
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[0]; print "Hello $input.";
At the MATLAB command line, type:
perl('hello.pl','World')
MATLAB displays:
ans = Hello World.
! (exclamation point), dos, regexp, system, unix
[1] UNIX is a registered trademark of The Open Group in the United States and other countries.
![]() | peaks | perms | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |