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 |
what are prefix dereferencer and list them out?
What is perl I used for?
Why do you program in Perl?
What happens to objects lost in "unreachable" memory, such as the object returned by Ob->new() in `{ my $ap; $ap = [ Ob->new(), $ap ]; }' ?
What are the various file operations in perl. Explain with example.
Write a script for 'count the no.of digits using regular expressions in perl..
Explain returning values from subroutines?
What does the qq{ } operator do?
Explain socket programming in perl?
What elements of the Perl language could you use to structure your code to allow for maximum re-use and maximum readability?
How to concatenate strings with perl?
How does polymorphism work in perl? Give an example.