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 |
There is no strict data types in perl unlike in other high level languages like Java so wouldn't that be a problem if a code in perl is to be a written by a big team of 20+ members ?"
What does next statement do in perl?
How to copy a file in perl?
Explain chomp, chop, cpan, tk.
What is the difference between use and require in perl programming?
Explain the difference between my and local?
What is the difference between perl list and perl array?
what is the procedure to define a user define module in your perl application?
What is perl shift array function?
How would you ensure the re-use and maximum readability of your perl code?
You want to concatenate strings with perl. How would you do that?
What does this symbol mean '->'?