However, due to the default level of precision and rounding that occurs behind the scenes, it took (on my system) 326 iterations for the number to be small enough (but still greater than 0) for perl to evaluate it as 0.

To bypass the default rounding and see that you have an infinate loop, you can add the bignum pragma module.

Code

#!usr/bin/perl

# ALWAYS start your scripts with these 2 pragmas use strict; use warnings; #use bignum; # uncomment this line to see the infinite loop