develooper Front page | perl.perl5.porters | Postings from June 2004

sort in scalar context, but broken due to inexperience.

From:
David Nicol
Date:
June 7, 2004 20:30
Subject:
sort in scalar context, but broken due to inexperience.
Message ID:
40C532E3.50209@pay2send.com

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



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About