I cooked together a simple patch based on bart's suggestion, submitted to the module author also. My module version is 2.40 (latest

WARNING: Barely tested. Use at your own risk. Works for Me(tm).

1107c1107 < $config_string = $this->_store(0, %{$this->{config}}); --- > $config_string = $this->_store(0, \%{$this->{config}}); 1114c1114 < $config_string = $this->_store(0,%{$config}); --- > $config_string = $this->_store(0,\%{$config}); 1140c1140 < return $this->_store(0, %{$this->{config}}); --- > return $this->_store(0, \%{$this->{config}}); 1147c1147 < return $this->_store(0, %{$config}); --- > return $this->_store(0, \%{$config}); 1158c1158 < my($this, $level, %config) = @_; --- > my($this, $level, $config) = @_; 1169,1171c1169,1171 < foreach my $entry (sort keys %config) { < if (ref($config{$entry}) eq 'ARRAY') { < foreach my $line (sort @{$config{$entry}}) { --- > foreach my $entry (sort keys %{ $config }) { > if (ref($$config{$entry}) eq 'ARRAY') { > foreach my $line (sort @{$$config{$entry}}) { 1173c1173 < $config_string .= $this->_write_hash($level, $entry, $li +ne); --- > $config_string .= $this->_write_hash($level, $$entry, $l +ine); 1176c1176 < $config_string .= $this->_write_scalar($level, $entry, $ +line); --- > $config_string .= $this->_write_scalar($level, $$entry, +$line); 1180,1181c1180,1181 < elsif (ref($config{$entry}) eq 'HASH') { < $config_string .= $this->_write_hash($level, $entry, $config +{$entry}); --- > elsif (ref($$config{$entry}) eq 'HASH') { > $config_string .= $this->_write_hash($level, $$entry, $$conf +ig{$entry}); 1184c1184 < $config_string .= $this->_write_scalar($level, $entry, $conf +ig{$entry}); --- > $config_string .= $this->_write_scalar($level, $$entry, $$co +nfig{$entry}); 1189,1191c1189,1191 < foreach my $entry (keys %config) { < if (ref($config{$entry}) eq 'ARRAY') { < foreach my $line (@{$config{$entry}}) { --- > foreach my $entry (keys %{ $config }) { > if (ref($$config{$entry}) eq 'ARRAY') { > foreach my $line (@{$$config{$entry}}) { 1200,1201c1200,1201 < elsif (ref($config{$entry}) eq 'HASH') { < $config_string .= $this->_write_hash($level, $entry, $config +{$entry}); --- > elsif (ref($$config{$entry}) eq 'HASH') { > $config_string .= $this->_write_hash($level, $entry, $$confi +g{$entry}); 1204c1204 < $config_string .= $this->_write_scalar($level, $entry, $conf +ig{$entry}); --- > $config_string .= $this->_write_scalar($level, $entry, $$con +fig{$entry}); 1269c1269 < $config_string .= $this->_store($level + 1, %{$line}); --- > $config_string .= $this->_store($level + 1, \%{$line});

In reply to Re: PATCH - Retaining hash order with Config::General? by Anonymous Monk
in thread Retaining hash order with Config::General? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.