title: What is the difference between {} and ->{} in Perl?
body: <p>So if I have some data object and I want to access whats inside the element of that object</p>
  <p>Whats the difference between</p>
  <pre class="lang-perl prettyprint-override"><code>$Data{isEnabled})
  
  $Data-&gt;{isEnabled}
  </code></pre>
  <p>my data is basically like this</p>
  <pre class="lang-perl prettyprint-override"><code>for my $characterData (@{$AllCharacters-&gt;{'characters'}}) {
  $Data{isEnabled})
  
  $Data-&gt;{isEnabled}
  </code></pre>
  <p>and i want to access certain elements of my characterData but I'm not sure when to use</p>
  <pre><code>$Data{isEnabled})
  </code></pre>
  <p>vs</p>
  <pre><code>$Data-&gt;{isEnabled}
  </code></pre>
  <p>Like for example why does the first print work but the second fails?</p>
  <pre class="lang-perl prettyprint-override"><code>use strict;
  use warnings;
  
  
  my %info = (NAME =&gt; &quot;John&quot;, HOST =&gt; &quot;Local&quot;, PORT =&gt; 80);
  
  print $info{PORT};
  print $info-&gt;{PORT};
  </code></pre>