If you actually need to extract the number with a regex you can use something like:
while(<F>){
/(\d+\.\d+)/;
if (abs($1 - 5.56)<=.1)
{print $1,"\n"}
}
(If there is more than one number on a line, you'll have to do something a little different, but it looks like that's not the case from your original code.)
chas
(
Update: I'm now a little unhappy about this because I noticed that
abs(5.56-5.66)<=.1 returns false. I wonder if
Test::Number::Delta as suggested by
trammell is more reliable in this respect. From the docs it looks like it may not be, but I haven't tried it...)