use Data::Dumper; use Sort::Naturally; $Data::Dumper::Sortkeys = sub { my ($hash) = @_; return [ nsort( keys %$hash ) ]; };