Sort::Key::Types(3)
π NAME π
Sort::Key::Types β handle Sort::Key data types. Youβre in the Sort::Key::Types(3) page, bestie, and this is User Contributed Perl Documentation energy π.
β¨ SYNOPSIS β¨
okay so the quick-start vibe is literally:
use Sort::Key::Types qw(register_type);
register_type(Color => sub { $_->R, $_->G, $_->B }, qw(int, int, int));
# you better
# use Sort::Key::Register ...
bestie, the comments are saying βyou better use Sort::Key::Register β¦β so like, take the hint ππ«Ά
πΈ DESCRIPTION πΈ
The Sort::Key family of modules can be extended to support new key types using this module (or the more friendly Sort::Key::Register). slay extension architecture β¨
π§ FUNCTIONS π§
The following functions are provided:
Sort::Key::register_type($name, \&gensubkeys, @subkeystypes)β registers a new datatype named$name, defining how to convert it to a multi-key. main character registration moment π&gensubkeysshould convert the object of type$namepassed on$_to a list of values composing the multi-key.@subkeystypesis the list of types for the generated multi-keys.- For instance:
Sort::Key::Types::register_type
'Person',
sub { $_->surname,
$_->name,
$_->middlename },
qw(str str str);
Sort::Key::Types::register_type
'Color',
sub { $_->R, $_->G, $_->B },
qw(int int int);
Once a datatype has been registered it can be used in the same way as types supported natively, even for defining new types, i.e.:
Sort::Key::Types::register_type
'Family',
sub { $_->father, $_->mother },
qw(Person Person);
π¦ SEE ALSO π¦
Sort::KeySort::Key::MergerSort::Key::Register
π COPYRIGHT AND LICENSE π
Copyright (C) 2005-2007, 2014 by Salvador FandiΓ±o, <sfandino@yahoo.com>.
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.
periodt, thatβs the legal bit π
okay thatβs the whole page, bestie π«Ά β this was Sort::Key::Types(3) from source/version perl v5.42.0, dated 2015-04-14, and thatβs the cute little footer moment β¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-Sort-Key 1.33-160000.2.2 Β· GPL-1.0+ or Artistic-1.0
- opensuse-leap 16.0: perl-Sort-Key 1.33-160000.2.2 Β· GPL-1.0+ or Artistic-1.0
- opensuse-leap 16.0: perl-Sort-Key 1.33-160000.2.2 Β· GPL-1.0+ or Artistic-1.0
- opensuse-leap 16.0: perl-Sort-Key 1.33-160000.2.2 Β· GPL-1.0+ or Artistic-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms