title: How do I avoid an uninitialized value?
body: <p>I use this <code>scrub</code> function to clean up output from other functions.</p>
  
  <pre><code>#!/usr/bin/perl
  use warnings;
  use strict;
  use Data::Dumper;
  
  my %h = (
      a =&gt; 1,
      b =&gt; 1
      );
  
  print scrub($h{c});
  
  sub scrub {
      my $a = shift;
  
      return ($a eq '' or $a eq '~' or not defined $a) ? -1 : $a;
  }
  </code></pre>
  
  <p>The problem occurs when I also would like to handle the case, where the key in a hash doesn't exist, which is shown in the example with <code>scrub($h{c})</code>.</p>
  
  <p>What change should be make to <code>scrub</code> so it can handle this case?</p>