my @sorted = sort {$a->{projname} cmp $b->{projname}} @Data; # To get the same kind of format as before ... foreach (@sorted) { my %temp = %$_; print "@temp{@fields}\n"; }