in reply to How to shorten this particular code
Looks to me like you need a major rethink of your data structure. I'd be heading for something like:
my @data; for my $itemIndex (0 .. 47) { $data[$itemIndex]{finalMap} = GetTheData ($itemIndex + 1); $data[$itemIndex]{sorted} = sortedHash ($data[$itemIndex]{finalMap +}); $data[$itemIndex]{percentile} = sortedHash ($data[$itemIndex]{sort +ed}); }
but without a whole lot more context it's very hard to give good advice.
The important point is that whenever you start down the path of "$id1, $id2, $id3" you should really be thinking in terms of an array: "$id[0], $id[1], $id[2]"
|
|---|