in reply to optimize percentile counting in hash

its taking like infinite time.

No, it's not running at all because of the errors.

First, add use strict; use warnings;

Then, realize that variable names like $_$i, $temp1_array$ct and $temp1_array$i are invalid. (A scalar starts with a '$'; you can't have one embedded.)

If you're trying to use them as hashes, you'd say $temp1_array{ $i }. If as an array, $temp1_array( $i ).

Try making those changes, and see what happens as a result.

(By the way, when posting code, it helps the rest of us if you bracket it with <code> and </code>.)

Good luck with the program!