[jidanni (AT) jidanni (DOT) org - Mon Feb 28 12:13:02 2005]:
Perlop talks tons about qx/STRING/'s STDUT and STDERR, but forgets to
mention its STDIN!
E.g., if qx/echo "$input"|command/ or qx/command < input_file/ are all
one can use, or can one hook things up from inside perl.
STDIN mentioned based on the request in the ticket.
Change 28156 by stevep@stevep-kirk on 2006/05/11 00:09:53
Adding a mention of STDIN processing by qx// as requested by
RT #34288: perlop: qx/STRING/: mention STDIN
Affected files
//depot/perl/pod/perlop.pod#144 edit
Differences
//depot/perl/pod/perlop.pod#144 (text)
@@ -1340,6 +1340,15 @@
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: