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 ?



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

Post New Answer

More CGI Perl Interview Questions

Write a script to reverse a string without using Perl's built in function

8 Answers   Nokia,


Explain grooving and shortening of arrays and splicing of arrays?

0 Answers  


What is the difference between perl array and perl hash?

0 Answers  


Explain the difference between use and require?

5 Answers   Aspire,


What does localtime() do in perl?

0 Answers  


What is perl dbi?

0 Answers  


What is the syntax used in Perl grep function?

0 Answers  


What is subroutine in perl?

0 Answers  


How to connect to SQL server through Perl?

0 Answers  


Explain goto label, goto name, and goto expr?

0 Answers  


What does redo statement do in perl?

0 Answers  


I have created a CGI-based page,after entering all the values in to the fields, How to get the output on the web browser using Perl

4 Answers  


Categories