Perl

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • perlop: qx/STRING/: mention STDIN

    0 answers - 1206 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    [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:

Re: perlop: qx/STRING/: mention STDIN


max 4000 letters.
Your nickname that display:
In order to stop the spam: 4 + 4 =
QUESTION ON "Perl"

EMSDN.COM