How to sort dates in Perl ?
Answer / 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 |
What are prefix dereferencer?
Explain about typeglobs?
Write a program to download the contents from www.perlinterview.com/answers.php website in Perl.
How do you debug a Perl scripting ( at the compile time error or run time error) in Unix environment ?
What is the use of command “use strict”?
What is perl shift array function?
How do I pass a command line argument in perl?
In Perl, there are some arguments that are used frequently. What are that arguments and what do they mean?
Why does Perl not have overloaded functions?
what is Chop & Chomp function does?
When do you use perl programming?
What does delete function do in perl?