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 |
Write a script to reverse a string without using Perl's built in function
Explain grooving and shortening of arrays and splicing of arrays?
What is the difference between perl array and perl hash?
Explain the difference between use and require?
What does localtime() do in perl?
What is perl dbi?
What is the syntax used in Perl grep function?
What is subroutine in perl?
How to connect to SQL server through Perl?
Explain goto label, goto name, and goto expr?
What does redo statement do in perl?
I have created a CGI-based page,after entering all the values in to the fields, How to get the output on the web browser using Perl