use strict; use warnings; use IO::File; my $pipe = "/tmp/mypipe"; system('mkfifo', '--', $pipe) if !-p $pipe; open(my $to_child, '|-', "cat > ".text_to_shell_lit($pipe)) or die "Can't open create process 1: $!"; $to_child->autoflush(1); open(my $fr_child, '|-', "cat < ".text_to_shell_lit($pipe)) or die "Can't open create process 2: $!"; my $input = '12345678901234567890123456789012345678901234567890'; print($to_child $input); close($to_child); while (<$fr_child>) { print; }