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 = ;close
X;
foreach my $line
(@lines){ print "$line\n"; }
Ken
-Original Message-From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]On Behalf Of
MarkusSent: Wednesday, November 02, 2005 3:40 AMTo:
perl-win32-users@listserv.ActiveState.comSubject: calling a
external program
Hi
all,
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 to make a post
processing.
Only to forward the STDOUT to a
file is a idea, but based on other reasons not useful for
me.
The variable $result contain only
the return code if the external program us supporting
this.
Markus
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs