title: Parsing a string into a hash structure in perl
body: <p>I have the following string:</p>
  
  <pre><code>$str = "list
      XYZ
  
      status1    : YES
      value1     : 100
      status2      : NO
      value2     : 200
  Thats all";       
  </code></pre>
  
  <p>I want to convert it into a hash using a function which takes this string as input and returns a hash with <code>status1</code> as <em>key</em> and <code>YES</code> as <em>value</em> for example.</p>
  
  <p>How to do so?<br>
  And how to reference the returned hash?</p>