http://www.perlmonks.org?node_id=1010276


in reply to log() and int() problem

log returns a floating point value, not an integer. See this FAQ