Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to sort dates in Perl ?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is perl compiler or interpreter?

886


How do I generate a list of all .html files in a directory?

898


How can the user execute a long command repeatedly without typing it again and again?

858


Explain grooving and shortening of arrays?

1026


What are the different types of perl operators?

973


What is cpan ? What are the modules coming under this?

867


Write a program to show the process of spawning a child process

809


What does a die() function do in perl?

929


What is the difference between single (') and double (") quote in a string in perl?

901


List the files in current directory sorted by size ?

929


What are the steps involved in configuring a server using cgi programming?

847


How to close a directory in perl?

869


what are prefix dereferencer and list them out?

974


Differentiate between c++ and perl.

943


What are the arguements we normally use for perl interpreter?

904