summaryrefslogtreecommitdiff
path: root/pod/perlop.pod
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@engin.umich.edu>1997-06-22 14:49:16 +1200
committerTim Bunce <Tim.Bunce@ig.co.uk>1997-08-07 00:00:00 +1200
commitbb32b41a1664739c880b279946697979bfd57ab1 (patch)
treefc630a088a5dfa88fbc3f275458f3ca5543a620a /pod/perlop.pod
parent26f28346883474bb3e28ea6c2c3205eb54147457 (diff)
downloadperl-bb32b41a1664739c880b279946697979bfd57ab1.tar.gz
multiline commands in qx//
On Mon, 21 Jul 1997 15:50:03 EDT, Ilya Zakharevich wrote: >In article <199707202332.TAA05144@aatma.engin.umich.edu>, >Gurusamy Sarathy <gsar@engin.umich.edu> wrote: >> +the system's command shell for parsing (this is C</bin/sh -c> on Unix >> +platforms, but varies on other platforms). 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: > >"If there are none" should be changed to "if command contains no shell >metacharacters". Here's a newer version of that doc patch. Ignore the old one. p5p-msgid: 199707212350.TAA18496@aatma.engin.umich.edu
Diffstat (limited to 'pod/perlop.pod')
-rw-r--r--pod/perlop.pod18
1 files changed, 18 insertions, 0 deletions
diff --git a/pod/perlop.pod b/pod/perlop.pod
index 32a0827cb3..2709a9eaa2 100644
--- a/pod/perlop.pod
+++ b/pod/perlop.pod
@@ -808,6 +808,24 @@ with $/ or $INPUT_RECORD_SEPARATOR).
$today = qx{ date };
+Note that how the string gets evaluated is entirely subject to the
+command interpreter on your system. On most platforms, you will have
+to protect shell metacharacters if you want them treated literally.
+On some platforms (notably DOS-like ones), the shell may not be
+capable of dealing with multiline commands, so putting newlines in
+the string may not get you what you want. You may be able to evaluate
+multiple commands in a single line by separating them with the command
+separator character, if your shell supports that (e.g. C<;> on many Unix
+shells; C<&> on the Windows NT C<cmd> shell).
+
+Beware that some command shells may place restrictions on the length
+of the command line. You must ensure your strings don't exceed this
+limit after any necessary interpolations. See the platform-specific
+release notes for more details about your particular environment.
+
+Also realize that using this operator frequently leads to unportable
+programs.
+
See L<"I/O Operators"> for more discussion.
=item qw/STRING/