Help for this page

Select Code to Download


  1. or download this
    # generally pointless, I would not use the mere existence of the key t
    +o mean anything; check it's value
    if ( exists $hashtest{abc} and defined $hashtest{abc} ) {
      print qq{This is worthless IMO.\n};
    }
    
  2. or download this
    if (defined $hashtest{abc}) {
      print qq{Better than 'exists'; check for the value being undef or no
    +t undef.\n};
    }
    
  3. or download this
    if (defined $hashtest{abc} and $hashtest{abc}) {
      print qq{Also, better than 'exists' and when I want to make sure the
    + value is not "falsey"\n};
    }