@eddhig22: "Hello
I have been using Ti888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4IxHash to keep my hash sorted but now
         if (( $tmp > $max )||($tmp = 1)) {
             tie my (%slic), 'Ti888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4IxHash';
             foreach my $ky ( @kdslic ){
                 $slic{$sym}{$ky} = $$dbits{$ky};
             }
             $#{$set{1}} == $enf ? return $set : push 
@{$set->{$tmp}},\%slic;
print Dumper %set;
the $ky is not sorted. how can I keep them sorted in this case?
thanks"
    @tadmc: "<quote>
                                     ^^^
                                     ^^^
That almost for sure does not do what you think it does.
Do you really want to set the value of $tmp to one?
    Tad McClellan                          SGML consulting
    <email_address>                   Perl programming
    Fort Worth, Texas"
    @noreply: "<quote>
$ky is not a hash. $ky represents a key in an anonymous hash to which 
$slic{$sym} is a reference. To me, your question indicates that you 
need to further read up on references and complex data structures:
     <url>
     <url>
As regards the question you probably intended to ask, Ti888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4IxHash can 
be used to preserve the order of the elements also for anonymous 
hashes. Consequently, right before the foreach loop above, you can do:
     tie %{$slic{$sym}}, 'Ti888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4IxHash';
Gunnar Hjalmarsson
Email: <url>"
    @REMOVEsdnCAPS: "-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Edo <email_address> wrote in news:<email_address>:
<quote>
...
Why do you feel you need to *keep* it sorted?  Nearly always, one doesn't 
care about the order of keys until one prints out the structure.  Why not 
use a regular hash (MUCH faster than a tied hash), and sort the keys at 
output time?
-  
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print
-BEGIN PGP SIGNATURE-
Version: PGPfreeware 7.0.3 for non-commercial use <<url>
iQA/AwUBP8Uw7GPeouIeTNHoEQK+hgCgy3Sbhi+e3cjfLEeiiHIniqDZA1MAn16X
aBno4M1fZkaezUviWlC/FePd
=L1N6
-END PGP SIGNATURE-"
    @eddhig22: "<quote>
maybe, I am not sure, over my head. my brain is allready stratched with 
the code below to try to change unless for very good reasons.
the sub check must have the correct order or sort of the keys.
sub scan ($\%\%\%) {
     my ($file, $dbits, $sbits, $set) = @_;
     my @kd = sort {$a <=> $b} (keys %$dbits);
     my @ks = sort {$a <=> $b} (keys %$sbits);
     my @vs = @$sbits{ @ks };
     for( 0 .. (@kd - @ks) ) {
         my @kdslic =  @kd[$_ .. $_+@ks-1 ];
         my @vdslic = @$dbits{@kdslic};
         my $tmp = check( \@vdslic, \@vs );
         my $sym = $1 if ($file =~/.+\/(\w+)\./);
         my @k = keys %$set;
         my $max = (sort {$b <=> $a} @k)[0] || 0;
         if (( $tmp > $max )||($tmp == 1)) {
#            tie my (%slic), 'Ti888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4IxHash';
#            tie %{$slic{$sym}}, 'Ti888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4IxHash';
             foreach my $ky ( @kdslic ){
                 $slic{$sym}{$ky} = $$dbits{$ky};
             }
             $#{$set{1}} == $enf ? return $set : push 
@{$set->{$tmp}},\%slic;
         }
     }
}
now how can I print the %set with all its keys and sub-keys sorted if I 
don't use tie at each level?"
{'source': 'USENET', 'other_information': '{"reply_count": 4, "forum_name": "comp.lang.perl.misc.20140729.mbox"}', 'file': 'data/output/usenet-comp.lang.parquet'}