my @tests = ( # $string, $pos, $expected, $description [ "\nString\n", 2, 6, 'Surrounded' ], [ "String\n", 2, 6, 'No first \n' ], [ "\nString", 2, 6, 'No last \n' ], [ "String", 2, 6, 'No \n' ], [ "", 0, 0, 'Blank' ], ); #### Rate op_ver daxim rlindex cur_strlen op_ver 564186/s -- -23% -66% -86% daxim 737063/s 31% -- -56% -81% <-- HERE rlindex 1677856/s 197% 128% -- -57% cur_strlen 3932672/s 597% 434% 134% -- #### not ok 1 - daxim: Surrounded # Failed test 'daxim: Surrounded' # at /home/ryan/src/perlmonks/subline.pl line 37. # got: '7' # expected: '6' Use of uninitialized value $prev in subtraction (-) at /home/ryan/src/perlmonks/subline.pl line 64. not ok 2 - daxim: No first \n # Failed test 'daxim: No first \n' # at /home/ryan/src/perlmonks/subline.pl line 37. # got: '7' # expected: '6' Use of uninitialized value $prev in subtraction (-) at /home/ryan/src/perlmonks/subline.pl line 64. not ok 3 - daxim: No last \n # Failed test 'daxim: No last \n' # at /home/ryan/src/perlmonks/subline.pl line 37. # got: '1' # expected: '6' Use of uninitialized value $prev in subtraction (-) at /home/ryan/src/perlmonks/subline.pl line 64. Use of uninitialized value $next in subtraction (-) at /home/ryan/src/perlmonks/subline.pl line 64. not ok 4 - daxim: No \n # Failed test 'daxim: No \n' # at /home/ryan/src/perlmonks/subline.pl line 37. # got: '0' # expected: '6' Use of uninitialized value $prev in subtraction (-) at /home/ryan/src/perlmonks/subline.pl line 64. Use of uninitialized value $next in subtraction (-) at /home/ryan/src/perlmonks/subline.pl line 64. ok 5 - daxim: Blank