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


in reply to Integer regex, different results in windows and mac - I just need regex help

You've probably got DOS line endings in your data. Try adding $num =~ s/\s+$//; to the top of the loop.

Dave.