< Perl Programming < Keywords
The system keyword
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
system LIST
system PROGRAM LIST
syscall | sysopen | sysread | sysseek | system | syswrite |
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.