sub is_int { my $warned = 0; local $SIG{__WARN__} = sub { $warned++ }; local $^W = 1; $_[0] == int $_[0] and not $warned; }