in reply to Simple Parsing of JavaScript function names using Parse-RecDescent

I appreciate everyone's advice and suggestions on improving speeds and with using gettimeofday(), but the real problem is that the 'funct2a' and 'funct2b' functions which are embedded deep in if statements (brace_statement) are being returned as an array... and I'd like the output to either concatenate the array elements into a comma-separated string so that in the output, 2: would look like (funct2a,funct2b) rather than the (ARRAY(0x25ec9bc))...

One way I could do this is by flattening this multi-dimensional array that gets returned into one array - or by doing it in the grammar (which is probably more efficient)? If someone knows how to do either (both would be great for learning) that would be awesome.

I've changed the output code to do this

foreach my $parsedValue (@$refParsedValues) { print Dumper($parsedValue) if ($parsedValue); }
which produces these results on the array structure that is returned to me.
Compile Time: 0.3 seconds ---------------------------------------------------------------------- +-- $VAR1 = [ '', '' ]; $VAR1 = [ '', '' ]; $VAR1 = [ 'funct1', '', '' ]; $VAR1 = [ '', '' ]; $VAR1 = [ '', [ '', [ 'funct2a', 'funct2b', '' ], '' ], '' ]; $VAR1 = 'funct3'; $VAR1 = 'funct4'; $VAR1 = 'funct5'; $VAR1 = 'funct6'; $VAR1 = 'funct7'; ---------------------------------------------------------------------- +-- Parse Time: 1.1 seconds Total Time: 1.4 seconds
What we really wanted was an array that printed like this:
$VAR1 = 'funct1'; $VAR1 = 'funct2a'; $VAR1 = 'funct2b'; $VAR1 = 'funct3'; $VAR1 = 'funct4'; $VAR1 = 'funct5'; $VAR1 = 'funct6'; $VAR1 = 'funct7';