perlquestion
frankus
Ok, I've got a piece of code where an array is sorted.<br>
Sometimes the array is all numbers, other times all characters.<br>
The artless way (to me) seemed to be to check the first element and sort depending on that.<p>
What I settled for was a catch-all:
<code>
for my $line (sort {unpack('C4',$a) <=> unpack('C4',$b) } keys %$value) {
tinker_with($line);
}
</code>
<p>
Some of the time the job of the Pack is redundant, other times, not so.<br>
Is there a better way of doing this?
<p>--<br></br>
<i>Brother <A HREF="/index.pl?node=Frankus&amp;amp;lastnode_id=1072">Frankus</a>.</i>
<p align="center">¤</p>