Help for this page

Select Code to Download


  1. or download this
      DB<160> @a=("1",0)
     => (1, 0)
    ...
    
      DB<163> if (grep { $_+0 ne $_ } @a)  { "string" } else { "num" } 
     => "string"
    
  2. or download this
      DB<166> @a=("1 ",0,"")
     => ("1 ", 0, "")
    ...
    
      DB<168> (grep { $_+0 ne $_ } @a) > @a/2
     => 1
    
  3. or download this
      DB<186> use Scalar::Util qw/looks_like_number/
     => 0
    
      DB<187> grep { ! looks_like_number($_) } 0,"1","2 ", 3.14, " 4 ", 5e
    +55, "six"
     => "six"