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.


In reply to Re (tilly) 1: Simple Parsing of JavaScript function names using Parse-RecDescent by tilly
in thread Simple Parsing of JavaScript function names using Parse-RecDescent by Incognito

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.