#!perl use warnings; use strict; use utf8; use Scalar::Util 'looks_like_number'; my $count = 1; # Wide ASCII one, Unicode FF11. my $ff11 = '1'; my $warned; if ($ff11 =~ /\d/) { print "ok $count\n"; } else { print "not ok $count\n"; } $count++; # Catch warnings. $SIG{__WARN__} = sub { $warned = "@_"; }; if ($ff11 >= 1) { print "ok $count\n"; } else { print "not ok $count\n"; } $count++; if ($warned) { print "not ok $count - warning '$warned'\n"; } else { print "ok $count - no warnings\n"; } $count++; if (looks_like_number ($ff11)) { print "ok $count\n"; } else { print "not ok $count\n"; } print "1..$count\n";