perlquestion
jesuashok
Hi
<p>
Please give me a Idea to sort the following array.
<code>
#!/usr/local/bin/perl
my @array = ( '1-1', '2-5', '1-10', '1-3','2-1');
print "value :" , $_ , ":\n" foreach ( sort @array );
</code>
<b>Result:-</b>
<code>
value :1-1:
value :1-10:
value :1-3:
value :2-1:
value :2-5:
</code>
But I want to have the following Result
<code>
value :1-1:
value :1-3:
value :1-10:
value :2-1:
value :2-5:
</code>
But I want the result should be in sorted order
</p>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-395537">
"Keep pouring your ideas"
</div></div><p><small>2005-12-18 Retitled by [Arunbear], as per consideration. <br />Original title: 'Interpreting each and element of the array efficiently'</small></p>