Answer Posted / kiruthikau
Try the following way.
Example
-------
use Data::Dumper;
my @dates = ( "02/11/2009" , "20/12/2001" , "21/11/2010" ) ;
@dates = sort { join( '', (split '/', $a)[2,1,0] ) cmp
join( '', (split '/', $b)[2,1,0]) } @dates;
print Dumper \@dates;
| Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
Explain split function in perl?
What does the’$_’ symbol mean?
What happens to objects lost in "unreachable" memory, such as the object returned by Ob->new() in `{ my $ap; $ap = [ Ob->new(), $ap ]; }' ?
How to read a file into a hash array?
List the operator used in Perl?
What is the difference between use and require in perl programming?
How to replace perl array elements?
What is cpan ? What are the modules coming under this?
What does `new $cur->{LINK}' do? (Assume the current package has no new() function of its own.)
What is v-strings?
What does 'do' statement do in perl?
How to change a directory in perl?
Explain tk?
Explain perl one-liner?
List all the features of perl programming?