$args = join(" ", @array); @output = `program $args`; # or use open: open(PROG, "program $args |") or die "program: $!"; @output = ; close(PROG);