REM { Sorting by three values for Lotus Domino (in a single view column). } MaxLength := 255; @Implode( @Transform( A : B : C; "key"; @If( @Length( key ) > 255; @Left( key; MaxLength ); key + @Repeat( @Char( 0 ); MaxLength - @Length( key ) ) ) #### # Sorting a three level hash in perl my $a_len = max( map length(), keys %h ); my $b_len = max( map length(), map keys %$_, values %h ); my $c_len = max( map length(), map keys %$_, map values %$_, values %h ); my $fmt = "a$a_len a$b_len a$c_len"; # Assumes \0 is not present in any keys my @sorted_keys = ( map [ unpack( "a$a_len a$b_len a$c_len ", $_ ) ], sort map( { my $a = $_; map( { my $b = $_; map( { pack( "a$a_len a$b_len a$c_len", $a, $b $_ ) } keys %{ $h{ $a }{ $b } } ) } keys %{ $h{ $a } } ) } keys %h );