(Perl) Compare the difference between numbers against a given tolerance