if (! (open ($fileHandler, '-|', "$Command 2>&1"))) { die "Cannot Open Command\n"; } my $ofh = select $fileHandler; $| = 1; select $ofh; while (<$fileHandler>) { sleep 30; print $_; ## Here i want to stop the command }