in reply to Restore the original order of an array after sort and performing some funchtion on array values

you want to look at hash slice syntax. Make a hash table mapping the original to the transform like so:
@hash{@original} = @original
work with them in the order you want
dosomethingto($_) for @hash{@sortedoriginal}
then get the transformed results as
@hash{@original}
  • Comment on Re: Restore the original order of an array after sort and performing some funchtion on array values
  • Select or Download Code