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 |
Explain ivalue?
What is the difference between having a parenthesis after module name and without parenthsis after module name?? i.e Package::Module(); and Package::Module;
what is the function of Return Value?
Explain 'grep' function.
What is perl scripting?
Which feature of Perl provides code reusability ? Give any example of that feature.
What are the functions that can be performed using cgi program?
what is Polymorphism in Perl?
What is perl programming?
Explain what is the scalar data and scalar variables in Perl?
How to create a package?
What does init 5 and init 0 do?