#!/usr/bin/perl use strict; use warnings; use Data::Dumper; use List::Util qw(shuffle); my $sort_order=< $i++}split ' ',$sort_order; my @keys = shuffle keys %sort_order; # shuffle not really needed, # but adds some credibility as to # the random nature of output print "SHUFFLED ARRAY...\n"; # randomized array print join("\n",@keys),"\n"; print "\n","RE-ORDERED ARRAY BY SORTING RULES\n"; print "THIS IS NOT A COPY OF THE INPUT ARRAY\n"; @keys = sort{$sort_order{$a} <=> $sort_order{$b}}@keys; print join("\n",@keys),"\n"; __END__ SHUFFLED ARRAY... shieldrate officercost maxHealth race curHealth metalcost curShield verbosetooltip latinumcost healthrate biomattercost unitname dilithiumcost maxSpecialEnergy specialenergydisplaymode tooltip specialEnergyRate buildtime crewcost maxshield RE-ORDERED ARRAY BY SORTING RULES THIS IS NOT A COPY OF THE INPUT ARRAY unitname tooltip verbosetooltip race buildtime officercost crewcost dilithiumcost latinumcost metalcost biomattercost maxHealth curHealth healthrate maxshield curShield shieldrate maxSpecialEnergy specialEnergyRate specialenergydisplaymode Process completed successfully