in reply to Re^2: Using <<EOL > output.out and EOL
in thread Using <<EOL > output.out and EOL

I assume you cannot do |- on Windows, is that a correct assumption?
No. Consider the code:
# p_1.pl use warnings; use strict; open my $ph, '|-', 'perl p_2.pl' or die 'opening pipe to p_2: $!'; print $ph <<EOP; hi there bye now EOP close $ph or die 'closing: $!'; print "$0 exiting \n"; exit; # p_2.pl use warnings; use strict; print "in $0: \U$_" while <STDIN>; print "in $0: exiting \n"; exit;
And output:
>perl p_1.pl in p_2.pl: HI THERE in p_2.pl: BYE NOW in p_2.pl: exiting p_1.pl exiting
For the rest, please see ikegami's Re^3: Using <<EOL > output.out and EOL.

Replies are listed 'Best First'.
Re^4: Using <<EOL > output.out and EOL
by newbie01.perl (Sexton) on Dec 03, 2009 at 12:42 UTC

    Thanks a lot. I sure do have a long, long, long, long way to go on these Perl stuff

    But just to clear up my head, |- means pipe the result of perl p_2.pl to open my $ph?

      But just to clear up my head, |- means pipe the result of perl p_2.pl to open my $ph?

      I would narrate that a little differently: 'In the script  p_1.pl, open a (pipe) handle named  $ph to the standard input of a  perl interpreter application that is started as a separate process and given the script  p_2.pl to interpret'. The data flow is all one-way:  p_1.pl to  p_2.pl via the  $ph pipe handle.

      See Pipe Opens in perlopentut.