I have a perl script that runs a program and puts the output of the program into a variable. The output of the file looks like:
Statistics 0
AverageTime: [0,0]
Statistics 0
AverageTime: [124,0]
I'm trying to run a regular express against this to pull out the first value in each of the parens and put it into an array
The expression I have is:
$result = `$program`;
@matches = ( $result =~ /AverageTime: \[(.*).\,/g);
When I print the arrary:
print "@matches\n";
I get all of the requested data, but its all on one line separated with spaces.
0 124
How do I get each match to be its on own in the array?