perl: fix detection of Perl >= 5.20 with autotools

(cherry picked from commit bf723ba7bf0b45609f94c23b0ac9436de0c1162a)