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:
regex1 => $regex1->(),
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 => sub {$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.
And yes, I was sort of expecting unpack() to be faster, but it is still better to try it to be sure.