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 |
How to turn on Perl warnings? Why is that important?
You want to connect to sql server through perl. How would you do that?
What is q (single q) operator in perl?
What is the syntax used in Perl grep function?
How many loop control keywords are there in perl?
How to open a directory in perl?
Can any1 tell me 2 write the script using perl script 2 looking at a log file 2 see wheather the test has passed or not.
How to access parameters passed to a subroutine in perl?
What is cpan ? What are the modules coming under this?
What is -> symbol in perl?
How to make the following assignment, as arrayreference assignment ? my $arr_ref='[1,2,3,4,4,'elem']';
How to deleting an existing file in perl programming?