use strict; use warnings; my $cmd = 'copy.exe'; my @args = ('from', 'to', '/z'); open(EXE, '-|', $cmd, @args) || die "$!"; while(){ print "read from program output: ".$_."\n"; } print "done.\n"; close(EXE);