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

The display times issue is due to the parens you have on the left hand side. As I pointed out in Arrays are not lists, there is a huge (and often misunderstood) issue of context. Your parens put the left hand side into list context, and then you only capture the first element of a 2 element list. You can either capture both elements and then combine them, or else just drop the parens like this example does:
use Time::HiRes qw(gettimeofday); my $time = gettimeofday(); print "The time is $time.\n";
You are now asking for a scalar, and it gives you a useful one. :-)

As for your performance problems, the cause of that is that TheDamian's module, while amazingly flexible, is very inefficient. His excuse for that is to be found at Re: advice with Parse::RecDescent. (In his defence the excuse is perfectly accurate.) And if you wish to help the rewrite he talked about happen, feel free to donate to the Perl development fund drive. (TheDamian is one of the core people supported by that fund.) Or feel free to write it yourself...

If you wish to do what the module does yourself, you will need to play with pos and the /g RE flag liberally.

  • Comment on Re (tilly) 1: Simple Parsing of JavaScript function names using Parse-RecDescent
  • Download Code