You can't store to a variable, since your program is no longer there :) ----- Original Message ----- From: "Yacketta, Ronald" <[EMAIL PROTECTED]> Date: Wednesday, June 20, 2001 4:10 pm Subject: exec() > Folks, > > I have been searching perldoc, books and some online resources as > to a way > to redirect output from exec() from stdout to a file (or possibly > an array) > > I am running the following (Thanxs to Paul for his skeleton code) > exec ( 'egrep'. "-c", $lookFor, @{$LOGS[($_ -1)]} ) > > basically, it is just forking a egrep -c looking for certain > patterns in the > array of files. > the output is spewed on STDOUT, which is normal BUT I would like > to have > that output > either (1) spewed to a flat file (2) spewed to an array/variable > (preferablythis option) > > Regards, > Ron >