in reply to sort hash by value

You can nest maps in much the same way you can nest for loops. It's not clear that there is a win doing that here, but consider:

my @items = map {$licensehash{$_->[0]}{$_->[1]}} sort {$a->[2] cmp $b- +>[2]} map { my $top = $_; map {[$top, $_, $licensehash{$top}{$_}[3]]} keys %{$licensehash{$_ +}} } keys %licensehash; print "$_->[3]: $_->[0]\n" for @items;

Prints:

Chassis Serial: Creation Date: Creation User: Customer Name: Epoc: Key Type: LMU Version: Lenovo Serial: Lenovo UUID: MAC 1/UUID: MAC 2: NAS: Sync Replication: iSCSI: iTX Version:

Note that @items contains the sorted values rather than the keys which cleans up the print statement somewhat. The map just to the right of the @items assignment does the lookup.

If the code changes take longer than the time saved, it's fast enough already.