title: Sorting a two-dimensional array in Perl based on value of one item, with exceptions
body: <p>Currently, I am working with a two dimensional array with information on soccer goals scored. Each item in the first array is an array with different information regarding the goal. The second item in this array is the minute scored (1-90) because I want them in sequential order so I can determine what they made the scoreline. I'm using that 'minutes' value to sort with this:</p>
  
  <pre><code>@allinfogoals = sort { $a-&gt;[1] &lt;=&gt; $b-&gt;[1] } @allinfogoals;
  </code></pre>
  
  <p>This works great, until I run into goals that were scored in extra time. The minutes for these are displayed like "90+2" or "45+3". Now, I can just add them together, but that could make the order incorrect. In this case, a goal scored right before half time could be stored as having been scored AFTER a goal that was scored shortly after the beginning of the second half.</p>
  
  <p>So, I'm finding the minutes that have this 90+x format and splitting them at the '+'. I'm storing the first value where I regularly store minutes in the array, but I added another at the end of the array (12th item) and I'm putting that second part (mins into extra time) there. That is 0 when it is a regular goal.</p>
  
  <p>How can I modify the sorting above to compensate this and have it maintain the proper order?</p>