use strict; use warnings; use IPC::Run qw( start ); my @c = qw( cmd /c sort ); my $h = start \@c, 'pipe', \*OUT; print IN "zzz...\n"; print IN "hello world\n"; close IN; pump $h; print uc while ; close OUT; finish $h;