Help for this page

Select Code to Download


  1. or download this
    perl -E '
        use Scalar::Util "looks_like_number";
    ...
    -Inf: 1
    Infinity: 1
    -Infinity: 1
    
  2. or download this
    perl -E '
        use Scalar::Util "looks_like_number";
    ...
    0b10: 0
    0o10: 0
    0x10: 0
    
  3. or download this
    perl -E '
        use Scalar::Util "looks_like_number";
    ...
    2: 1
    8: 1
    16: 1
    
  4. or download this
    sub IsNumber {
        state $re = qr{...};
        return $_[0] =~ $re;
    }
    
  5. or download this
    {
        my $re; BEGIN { $re = qr{...} }
    ...
            return $_[0] =~ $re;
        }
    }
    
  6. or download this
    $ perl -E 'say 1e6'
    1000000
    
  7. or download this
    $ perl -E 'say 1_000_000/1_000'
    1000