#!/usr/bin/perl use strict; use warnings; open TASK, "tasklist 2>&1|" or die "cannot open pipe to tasklist"; while () { print; }