cmpthese -1, { a=>q[ 1 while chop( $sa ) ], b=>q[ chop( $sb ) while $sb ne '' ] };; Rate b a b 8537447/s -- -59% a 20591583/s 141% --