my @list; for my $item(@array1) { # assumes you are reading the list into an array and also # assumes that the command between c1 and the newline is spurious push @list, $item; }