Smoothly interpolate the value Y from X using a list of (X, Y) pairs in Perl