my $Command = abc.exe my $pid = open ($fileHandler, '-|', "$Command 2>&1"); if ( ! defined $pid) { die "Cannot Open Command\n"; }