Help for this page

Select Code to Download


  1. or download this
    if ($array[0] =~ /^\d+$/) {
        # do something
    }
    
  2. or download this
    sub is_whole_number { $_[0] =~ /^\d+$/            }
    sub is_integer      { $_[0] =~ /^[+-]?\d+$/       }
    sub is_float        { $_[0] =~ /^[+-]?\d+\.?\d*$/ }