I couldn't get your test package to work, so I made a little
test script of my own which is more "straight-forward",
and some more "realistic data".
It sorts as advertised.
I'm not real good at dereferencing but I worked out a little
routine that will print out the sort results, and will dereference
the arrays and hashes that are returned automatically.
I hate it when you print out results, and get HASH019283474
or ARRAY1234234.
my LOH.pm test
##############################################
#!/usr/bin/perl
use warnings;
use strict;
use Sort::LOH;
my @SAMPLE_DATA = (
{ID => "a1 a", F_NAME => "asd b1 b", L_NAME => "ggfsdfc1 c"
+, STREET => "5",
{ID => "a2 b", F_NAME => "zxczxc b2 c", L_NAME => "sdvwevc2 d"
+, STREET => "2",
{ID => "a3 c", F_NAME => "cdaer b3 d", L_NAME => "sdfwbbfc3 e
+", STREET => "4",
{ID => "a4 d", F_NAME => "aaaa asdafsdf b4 e", L_NAME => "asdferwv c6
+ b", STREET => "4",
{ID => "a5 e", F_NAME => "vdasdvqd43 b5 f", L_NAME => "aaaaa c5 a"
+, STREET => "1",
{ID => "a6 f", F_NAME => "eee ecasd b6 a", L_NAME => "asdferwv c6
+ b", STREET => "6",
);
my @WACKY_DATA = (
{ID => "a1 a", NAMES => ["BOB", "ELLEN"], STREET => "2nd Ave.",
ADDRESS => "2", CITY => "Detroit"},
{ID => "a2 b", NAMES => ["SUE", "ROB"], STREET => [home=>"Birdview
+ Lane",vacation=>"Lake George Circle"],
ADDRESS => [home=>"9",vacation=>"20"], CITY => "Lake George"},
{ID => "a3 c", NAMES => ["JOHN", "JANE"], STREET => "1rst",
ADDRESS => "1045", CITY => "Lansing"},
{ID => "a4 d", NAMES => ["LOUIS", "ELLA"], STREET => "Silvery Lane",
ADDRESS => "13", CITY => "Macon"},
{ID => "a5 e", NAMES => ["RICK", "MARK"], STREET => "Plaza Center",
ADDRESS => "9", CITY => "Albany"},
{ID => "a6 f", NAMES => ["IGNATZ", "CRAZY"],STREET => "6th Street",
ADDRESS => "66", CITY => "Wackoville"}
);
######################################################################
+########
my $lohSorter = Sort::LOH->new(\@SAMPLE_DATA);
my @sorted = $lohSorter->sortMe(["STREET"]);
#print "@sorted\n";
foreach my $href(@sorted){
print "########################################\n";
foreach my $key (keys %$href){
print "$key ---> ${$href}{$key}\n";
}
print "########################################\n";
}
######################################################################
+########
print "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+\n";
######################################################################
+###
my $lohSorter1 = Sort::LOH->new(\@WACKY_DATA);
my @sorted1 = $lohSorter1->sortMe(["ADDRESS"]);
#print "@sorted1\n";
foreach my $href1(@sorted1){
# print Dumper(%$_);
print "########################################\n";
foreach my $key (keys %$href1){
if (${$href1}{$key} =~ /ARRAY/)
{print "$key --->@{${$href1}{$key}}\n"}
elsif (${$href1}{$key} =~ /HASH/)
{print "$key --->${${$href1}{$key}}\n"}
else {print "$key ---> ${$href1}{$key}\n"}
}
print "########################################\n";
}