in reply to Re^2: Performance problems on splitting long strings
in thread Performance problems on splitting long strings
You can simplify the calls to the anonymous subroutines. ...
Thank you for your comment, Jim.
And, yes, I wanted to write something like that, and that the reason why I built references to anonymous subs in the first place, rather than simple named functions. But for some reason, I got something wrong in the syntax for calling the subs in cmpthese, I am not sure to remember exactly, but I think I first did something like:
which gave compile errors. The first quick way I found to make it work was to wrap the function call in a sub block like this:regex1 => $regex1->(),
I realize that this is not the most elegant construct, but once it worked, I was happy enough to get my results and I was too tired, at around 2 a.m., to spend more time investigating further how to simplify the calls.regex1 => sub {$regex1->()},
And yes, I was sort of expecting unpack() to be faster, but it is still better to try it to be sure.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Performance problems on splitting long strings
by AnomalousMonk (Archbishop) on Feb 01, 2014 at 19:55 UTC | |
by Laurent_R (Canon) on Feb 01, 2014 at 23:24 UTC | |
by AnomalousMonk (Archbishop) on Feb 02, 2014 at 08:29 UTC | |
|
Re^4: Performance problems on splitting long strings
by Jim (Curate) on Feb 01, 2014 at 22:25 UTC |