Re: calling a external program

2005-11-02 Thread Karl-Heinz Kuth
Hi Markus, I’m looking for a way to call an external program and get back the result in an array without seeing anything on the STDOUT. If ‘m using in example $path = “\\”; $result = system(“dir”, $path); I can see the output on the STDOUT but I can’t find a way to put it in an array

RE: calling a external program

2005-11-02 Thread LeFevre, Ken
Marcus: Here's some code that will execute your command and return what would normally go to STDOUT to the array @lines. my $path = \\; my $cmd = dir$path";my @lines;open X, "$cmd |"; @lines = X;close X; foreach my $line (@lines){ print "$line\n"; } Ken -Original