NAME

Sort::Key::DateTime - Perl extension for sorting objects by some DateTime key

SYNOPSIS

use Sort::Key::DateTime;
my @sorted = dtkeysort { $_->date } @meetings;

DESCRIPTION

Sort::Key::DateTime allows to sort objects by some (calculated) key of type DateTime.

EXPORT

dtkeysort { CALC_DT_KEY } @array

return the elements on @array sorted by the DateTime key calculated applying { CALC_DT_KEY } to them.

Inside { CALC_DT_KEY }, the object is available as $_.

NOTE: sorting order is undefined when floating and non floating DateTime keys are mixed.

BTW, DateTime objects can be sorted as:

my @sorted = dtkeysort { $_ } @unsorted;

SEE ALSO

Sort::Key, perl sort function docs.

DateTime module documentation and FAQ available from the DateTime project web site at http://datetime.perl.org/

AUTHOR

Salvador Fandiño, <sfandino@yahoo.com<gt>

COPYRIGHT AND LICENSE

Copyright (C) 2005 by Salvador Fandiño

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.