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 |
Which has the highest precedence, List or Terms? Explain?
Explain the internal working of cgi
Which functions in perl allows you to include a module file.
What is the difference between use and require in perl?
Does Perl have objects? If yes, then does it force you to use objects? If no, then why?
Explain 'grep' function.
Explain different types of perl operators.
How many types of primary data structures in Perl and what do they mean?
What do you mean by context of a subroutine?
Which functions in Perl allows you to include a module file or a module and what is the difference between them?
I have one question regarding to eval function. I know eval function is use for error checking but I am not able to understand below line. eval \'exec perl -S $0 ${1+\"$@\"}\' if 0; $0 for script name $@ set if error occur
How to convert strings into an array in perl?