in reply to Infinite loop but no reason why

First, Perl's for( ; ; ) loop works just like the one in C (from which it was stolen).

Second, no matter the language, it is not a good idea to compare floating point numbers for equality. Your hunch is correct, precision issues defeat equality. Usually you want to compare the numbers within some tolerance like this:

if ( abs( $first_num - $second_num ) < $small_num ) ) { ... }
where small_num is your tolerance for various errors (try .0005 or some such).

Alternatively, you could round them to the same precision and compare.

Phil