Perl Programming/Keywords/system

Previous: sysseek Keywords Next: syswrite

The system keyword

edit

The system function does the same as exec LIST, but by starting a fork and waiting it to terminate. If LIST contains more than one value, or it is an array with more than one value, the first element constitutes the command and the rest the parametres. If only a scalar is passed, this is checked against metacharacters of the system shell and passed, if found, to the system for parsing. If there are no shell metacharacters in the argument, it is split into words and passed directly to the more efficient execvp.

On Windows, only system PROGRAM LIST will reliably avoid the shell.

Syntax

edit
  system LIST
  system PROGRAM LIST
syscall sysopen sysread sysseek system syswrite
Previous: sysseek Keywords Next: syswrite