Help for this page

Select Code to Download


  1. or download this
    use warnings;
    
    ...
    # Generates a warning that causes the handler to throw
    # the error
    if($string == 5) {print "Yep, \$string == 5\n"}
    
  2. or download this
    use Scalar::Util;
    .
    ...
       $x > 0) {
       print "It's a positive number - not necessarily an integer";
    }
    
  3. or download this
    use Scalar::Util;
    .
    ...
       $x > 0 && $x == int($x)) {
       print "It's a positive integer";
    }
    
  4. or download this
    use Scalar::Util;
    use warnings;
    ...
    Outputs:
    5.0000000000000000000000000000001
    looks like a positive integer