while ( ) { chomp; if ( abs( $input - $_ ) <= 0.1 ) { print "Value in list\n"; last; } }