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

How to turn on Perl warnings? Why is that important?

0 Answers  


You want to connect to sql server through perl. How would you do that?

0 Answers  


What is q (single q) operator in perl?

0 Answers  


What is the syntax used in Perl grep function?

0 Answers  


How many loop control keywords are there in perl?

0 Answers  


How to open a directory in perl?

0 Answers  


Can any1 tell me 2 write the script using perl script 2 looking at a log file 2 see wheather the test has passed or not.

3 Answers   TCS,


How to access parameters passed to a subroutine in perl?

0 Answers  


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

0 Answers  


What is -> symbol in perl?

0 Answers   HCL,


How to make the following assignment, as arrayreference assignment ? my $arr_ref='[1,2,3,4,4,'elem']';

2 Answers  


How to deleting an existing file in perl programming?

0 Answers  


Categories