Subject: | Allow custom sort order |
Hi Curtis, hope all's well with you in Amsterdam :-)
I've just been trying to dump a hash where every key is a number and
rather than the default cmp sort order I'd like to make it <=>. However,
unfortunately I can't seem to do that because in eq_or_diff you localize
$DD::Sortkeys to 1. Perhaps a new option like
sortkeys => sub { DD-like-subroutine }
would be nice to have? I think the only code change would be something like:
local $Data::Dumper::Sortkeys = exists $options->{sortkeys} ?
$options->{sortkeys} : 1;
which would also allow the user to set Sortkeys to 0 if they so wished
(not sure why anyone would want that though..)
Mark