use warnings would help you to find the problem. After two shifts $_[2] becomes $_[0]
In reply to Re: Benchmarking regexes by zwon in thread Benchmarking regexes by Anonymous Monk