# name: basicipc.pl # # Purpose: Receive the STDOUT from a secondary app in real time # and do some basic translation on it. End when the secondary # app ends. my $cmd = 'perl delayed.pl'; open(CMD, "$cmd |") or die "Can't open $cmd: $!"; while () { my ($num) = /(\d+)/; print $num % 2 ? 'odd: ' : 'even: '; print $_; } close(CMD);