diff options
Diffstat (limited to 'pod/perlfunc.pod')
-rw-r--r-- | pod/perlfunc.pod | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index a28487ac1d..cc9fa00238 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -1032,17 +1032,19 @@ in case 6. The exec() function executes a system command I<AND NEVER RETURNS>, unless the command does not exist and is executed directly instead of -via C</bin/sh -c> (see below). Use system() instead of exec() if you -want it to return. +via your system's command shell (see below). Use system() instead of +exec() if you want it to return. If there is more than one argument in LIST, or if LIST is an array with more than one value, calls execvp(3) with the arguments in LIST. If there is only one scalar argument, the argument is checked for shell -metacharacters. If there are any, the entire argument is passed to -C</bin/sh -c> for parsing. If there are none, the argument is split -into words and passed directly to execvp(), which is more efficient. -Note: exec() and system() do not flush your output buffer, so you may -need to set C<$|> to avoid lost output. Examples: +metacharacters, and if there are any, the entire argument is passed to +the system's command shell for parsing (this is C</bin/sh -c> on Unix +platforms, but varies on other platforms). If there are no shell +metacharacters in the argument, it is split into words and passed +directly to execvp(), which is more efficient. Note: exec() and +system() do not flush your output buffer, so you may need to set C<$|> +to avoid lost output. Examples: exec '/bin/echo', 'Your arguments are: ', @ARGV; exec "sort $outfile | uniq"; @@ -1061,6 +1063,10 @@ or, more directly, exec {'/bin/csh'} '-sh'; # pretend it's a login shell +When the arguments get executed via the system shell, results will +be subject to its quirks and capabilities. See L<perlop/"`STRING`"> +for details. + =item exists EXPR Returns TRUE if the specified hash key exists in its hash array, even @@ -3480,6 +3486,10 @@ signals and core dumps. } $ok = ($rc != 0); +When the arguments get executed via the system shell, results will +be subject to its quirks and capabilities. See L<perlop/"`STRING`"> +for details. + =item syswrite FILEHANDLE,SCALAR,LENGTH,OFFSET =item syswrite FILEHANDLE,SCALAR,LENGTH |