Sort::K...Register(3)
π Sort::K...Register(3) π
okay so bestie, this page is from User Contributed Perl Documentation, and it's all about Sort::Key::Register. the way this module just tells Sort::Key how to sort new data types? iconic. β¨
π NAME π
Sort::Key::Register β tell Sort::Key how to sort new data types. periodt. π
β¨ SYNOPSIS β¨
okay so here's the group-chat screenshot of how you use it, no cap:
use Sort::Key::Register Person =>
sub { $_->surname, $_->name },
qw(string string);
use Sort::Key::Register 'Color::Component' => 'integer';
use Sort::Key::Register Color =>
sub { $_->R, $_->G, $_->B },
('Color::Component') x 3;
πΈ DESCRIPTION πΈ
Sort::Key::Register allows one to register new data types with Sort::Key so that they can be sorted as natively supported ones. literally the glow-up those types needed. π
It works as a pragma module and doesn't export any function, all its functionality is provided via use. fr fr, it's giving:
use Sort::Key::Register ...
To avoid collisions between modules registering types with the same name, you should qualify them with the package name. bestie, do not skip this part:
use Sort::Key::Register 'MyPkg::foo' => sub { $_ }, '-int';
# or using __PACKAGE__:
use Sort::Key::Register __PACKAGE__, sub { $_ }, '-int';
π USAGE π
okay the two usable forms are giving:
use Sort::Key::Register $name => \&multikeygen, @keytypes;β registers type$name.&multikeygenis the multi-key extraction function for the type, and@keytypesare the types of the extracted keys. π«Άuse Sort::Key::Register $name => $keytype;β thisuseis useful for simple types that are sorted as another type already registered, maybe changing the direction of the sort (ascending or descending). π
π¦ SEE ALSO π¦
go look at Sort::Key and Sort::Key::Maker, bestie. iykyk π
π AUTHOR π
Salvador FandiΓ±o, <sfandino@yahoo.com> π
π COPYRIGHT AND LICENSE π
Copyright (C) 2005, 2014 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.
π
that's the whole manual page, bestie! source/version: perl v5.42.0; date: 2015-04-14. mwah π«Ά
π¦ 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