array executes only first

rasdj_at_frontiernet.net
Date: 03/04/05


Date: 4 Mar 2005 07:22:36 -0800

touch.txt is:

touch a
touch b

The following code produces the file "a" but not "b".

#!/usr/bin/perl
$data_file="touch.txt";
open(cmd, $data_file) || die("Could not open file!");
@raw_data=<cmd>;
close(cmd);
foreach $line (@raw_data)
{
   exec $line;
}

Thank you,

RasDJ