in reply to how to find median value

Why yes, $a % $b returns the remainder when $a is integer divided by $b. See perlman:perlop for more info.

So just sort the list and then determine which answer to give using the modulo operator %.

Note that some authors consider the median of a list with an even number of elements to be the arithmetic mean of locations n/2-1 and n/2.