var strings = %w(0 0.0 -123 abc 0x10 0xABC 123a -123e3 0.1E-5 50e); for str in strings { say ("%9s => %s" % (str, is_numeric(str))) }