in reply to $var == 1 fails when $var = 1
Math::BigFloat will make these calculations precise, though slower.
my $var = Math::BigFloat->new($x) + Math::BigFloat->new($y) + Math::BigFloat->new($z);
Just make sure to pass them to the Math::BigFloat constructor while they are still strings. If you use them as numbers first you could lose the precision before it can be stored.