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
What is it meants by '$_'?
What does redo statement do in perl?
Explain goto expr?
Demonstrate subroutines in perl with a simple example.
When would `local $_' in a function ruin your day?
What is the use of –w?
What are arrays in perl?
You want to print the contents of an entire array. How would you do that?
What happens to objects lost in "unreachable" memory, such as the object returned by Ob->new() in `{ my $ap; $ap = [ Ob->new(), $ap ]; }' ?
Mention what is cpan?
How can we create perl programs in unix, windows nt, macintosh and os/2 ?
What does length(%HASH) produce if you have thirty-seven random keys in a newly created hash?
How to convert strings into an array in perl?
What is the main function of cookie server?
How to connect to SQL server through Perl?