From: Steve Peters Date: Thu, 11 May 2006 00:09:53 +0000 (+0000) Subject: Adding a mention of STDIN processing by qx// as requested by X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3039822776c822d43b60790fc6d383f78daf60de;p=p5sagit%2Fp5-mst-13.2.git Adding a mention of STDIN processing by qx// as requested by RT #34288: perlop: qx/STRING/: mention STDIN p4raw-id: //depot/perl@28156 --- diff --git a/pod/perlop.pod b/pod/perlop.pod index 442c313..4dffa4f 100644 --- a/pod/perlop.pod +++ b/pod/perlop.pod @@ -1340,6 +1340,15 @@ when the program is done: system("program args 1>program.stdout 2>program.stderr"); +The STDIN filehandle used by the command is inherited from Perl's STDIN. +For example: + + open BLAM, "blam" || die "Can't open: $!"; + open STDIN, "<&BLAM"; + print `sort`; + +will print the sorted contents of the file "blam". + Using single-quote as a delimiter protects the command from Perl's double-quote interpolation, passing it on to the shell instead: