>perl -wMstrict -le "use Data::Dump; ;; my %IP_Store = qw( 11.0.0.1 UEH1_system_ip 11.0.0.11 UEH11_system_ip 11.0.0.3 UEH25_system_ip 11.0.0.25 UEH111_system_ip ); ;; ;; print 'Schwartzian Transform'; my @sorted1 = map $_->[0], sort { $a->[1] <=> $b->[1] } map { dd $_; $_; } map [ $_, /\d+/g ], values %IP_Store ; print qq{'$_'} for @sorted1; ;; ;; print 'Guttman-Rosler Transform'; my $n = 10; my $fmt = qq{%0${n}d}; my $unp = qq{x$n a*}; ;; my @sorted2 = map unpack($unp, $_), sort map { print qq{=$_=}; $_; } map sprintf($fmt, /\d+/g) . $_, values %IP_Store ; print qq{'$_'} for @sorted2; " Schwartzian Transform ["UEH25_system_ip", 25] ["UEH1_system_ip", 1] ["UEH11_system_ip", 11] ["UEH111_system_ip", 111] 'UEH1_system_ip' 'UEH11_system_ip' 'UEH25_system_ip' 'UEH111_system_ip' Guttman-Rosler Transform =0000000025UEH25_system_ip= =0000000001UEH1_system_ip= =0000000011UEH11_system_ip= =0000000111UEH111_system_ip= 'UEH1_system_ip' 'UEH11_system_ip' 'UEH25_system_ip' 'UEH111_system_ip'