You can't just eval that string, try:
cmpthese (-5,{ me => sub { mymatch($str,2,\@arr) }, jk => sub { amatch($str,['2'],@arr) } );

In reply to Re: Benchmarking String::Approx by Joost
in thread Benchmarking String::Approx by monkfan

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