>> > print sort (4,1,2,3);
>> >
>> > actually prints "4123", i.e. doesn't actually sort. Bug? Feature?
This broke between 5.001n and 5.002. There was a long winded thread
about sorting undefs in some order (rather than coredumping) around
the 5.002beta times (search for "bogorefs" in the subject-line on
p5p archive for details). Larry added in some code that presumes that
the private flags are set by the time qsort() is called:
Unfortunately, sv_2pv() does not set the POKp flag, so the above
code breaks! Here's a patch against 5.00306.
s = SvGROW(sv, len + 1);
SvCUR_set(sv, len);
(void)strcpy(s, tokenbuf);
- /* NO SvPOK_on(sv) here! */
+ SvPOKp_on(sv);
return s;
}
}