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

Explain ivalue?

0 Answers  


What is the difference between having a parenthesis after module name and without parenthsis after module name?? i.e Package::Module(); and Package::Module;

1 Answers  


what is the function of Return Value?

0 Answers  


Explain 'grep' function.

0 Answers  


What is perl scripting?

0 Answers  


Which feature of Perl provides code reusability ? Give any example of that feature.

1 Answers  


What are the functions that can be performed using cgi program?

0 Answers  


what is Polymorphism in Perl?

0 Answers  


What is perl programming?

0 Answers  


Explain what is the scalar data and scalar variables in Perl?

0 Answers  


How to create a package?

0 Answers  


What does init 5 and init 0 do?

0 Answers  


Categories