Attached is a patch to pp_sort.c that adds code to give a sortedness ratio in scalar context. It currently appears to cause the last element of the array to be returned rather than the sv_newmortal loaded with the ratio, as desired. Because I don't understand how exactly pp_sort is returning its return value. Empty and singleton arrays default to a sortedness ratio of 1. Help? -- davidnicol@pay2send.com "There's a fine line between participation and mockery" -- Scott Adams