#! /usr/bin/perl use strict; use IPC::Open2; local *PIPE; local *OUT; my $pid = open(PIPE, "-|", "echo", "hi") or die "Can't echo: $!"; print "The pid of the echo command is: $pid"; ; open2(\*OUT, "<&PIPE", "perl", "-ne", "print uc") or die "open2 failed: $!"; print while ;