#!/usr/bin/perl -w use warnings; use strict; my $epsilon=0.000005; my $desired=1.15; while () { chomp; if (abs($desired - $_) < $epsilon) { print "Match found: $_\n"; } } __DATA__ 1.149 1.1499 1.14999 1.149999 1.1499999 1.14999999 1.149999999