#!perl use v5.14; use warnings; use Test::More tests => 2;
my $val = "2.123450";
is( $val, 2.123450 ); cmp_ok( $val, '==', 2.123450 );
This results in:
1..2 not ok 1
The issue is fairly obvious when it's laid out like this: `is()` does a string comparison, which means that trailing zero matters. One day, though, I promise you, you'll hit a problem like this and will spend hours debugging it, only to smack your forehead when you finally see it. You can prevent that by explicitly giving a comparison operator to `cmp_ok()` instead.