title: How can I get an XML element's attribute with Perl's XML::Simple?
body: <p>I have a Perl script that reads a XML file that doesn't have content, only attributes in the element.</p>
  
  <p>Like this:</p>
  
  <pre><code>&lt;league&gt;
  &lt;game name="bla"/&gt;
  &lt;/league&gt;
  </code></pre>
  
  <p>Now I try to get the game attribute 'name'.</p>
  
  <p>I tried using <code>$xml-&gt;{league}-&gt;{game}-&gt;{name}</code> and <code>$xml-&gt;{league}-&gt;{game}-&gt;['name']</code> but they are both not working. Something about a hash problem.</p>
  
  <p>Is there anybody who can help me get the value?</p>