title: Why does this statment return true
body: <p>Why does this statement,</p>
  
  <pre><code>    if (! $ssh_options{user}) {
  
      delete $ssh_options{user};
  
  }
  </code></pre>
  
  <p>return true, but this statement</p>
  
  <pre><code>    if ($ssh_options{user} eq 'undef') {
  
      delete $ssh_options{user};
  
  }
  </code></pre>
  
  <p>give me the error,</p>
  
  <pre><code>Use of uninitialized value $ssh_options{"user"} in string eq at analyze.pl line 230.
  </code></pre>
  
  <p>I thought you always had to have something for perl to compare the value of the variable being compared.</p>
  
  <p>** Update **</p>
  
  <p>@ Quick Joe Smith</p>
  
  <p>I cannot base my comparison on whether the hash keys exist or not because the values for this hash</p>
  
  <pre><code>sub ssh_connect {
  
  my $host = shift;
  
  my %ssh_options = (
  
      port =&gt; shift,
      user =&gt; shift,
      password =&gt; shift
  
      );
  </code></pre>
  
  <p>Come from this function which calls the sub routine</p>
  
  <pre><code>        if ((exists $config_file{user}) &amp;&amp; (exists $config_file{password})) {
  
          my $vmware_user = $config_file{user};
  
          my $vmware_password = $config_file{password};
  
          ssh_connect($vmware_host, $vmware_port, $vmware_user, $vmware_password);
  
      } else {
  
          ssh_connect($vmware_host, $vmware_port);
  
      }
  </code></pre>