> C++ program's output looks like this:
>
> A= 20
> B= 30
> C= 70
> AVG= 40
> MIN= 30
> MAX= 70
> TIME= 0.0037
>
> If I call this in Perl:
>
> #!/usr/bin/perl -w
> my $result = `myapp`;
replace as :
my @results = `myapp`;
> exit;
>
> there is output myapp saved in $result
>
> How to move values from $result to my variables, like
Then :
my %data = ();
for (@results)
{ my ($key, $value) = split /= /, $_, 2;
chomp ($value);
$data{$key} = $value;
}
print $data{valA}; # you got 20
print $data{valB}; # you got 30
Rgds,
Connie
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]