http://www.perlmonks.org?node_id=517195

jesuashok has asked for the wisdom of the Perl Monks concerning the following question:

Hi

Please give me a Idea to sort the following array.

#!/usr/local/bin/perl my @array = ( '1-1', '2-5', '1-10', '1-3','2-1'); print "value :" , $_ , ":\n" foreach ( sort @array );
Result:-
value :1-1: value :1-10: value :1-3: value :2-1: value :2-5:
But I want to have the following Result
value :1-1: value :1-3: value :1-10: value :2-1: value :2-5:
But I want the result should be in sorted order

"Keep pouring your ideas"

2005-12-18 Retitled by Arunbear, as per consideration.
Original title: 'Interpreting each and element of the array efficiently'