Sub::CharacterProperties - Support for user-defined character properties
version 1.100860
my $n = Sub::CharacterProperties->new(characters => [ 'LATIN SMALL LETTER A', 'LATIN SMALL LETTER B', 'LATIN SMALL LETTER C', 'LATIN SMALL LETTER D', # ... ]); print $n->as_code('MySet');
As described in perlunicode, you can define your own character properties. To do so, you need to specify the ranges of allowed characters as pairs of hexadecimal numbers. There are easier ways of combining ranges with +, -, ! and &, but if you have a diverse set of characters you are going to have to deal with hex values.
+
-
!
&
This module aims at making your task of writing these character property subroutines easier.
Basically you create an object of this class, pass it a list of the Unicode character names of the characters you'd like to allow and then have it generate the character property subroutine.
Each character should be either a Unicode character name - such as LATIN SMALL LETTER A - or a hex code point - indicated by a leading 0x - this is useful for characters that don't have a name.
LATIN SMALL LETTER A
0x
The character property subroutines are a compile-time feature, so unfortunately this module can't just install the generated subroutine. You will have to copy-and-paste it into your program.
Assumes that the characters() have been set.
characters()
Returns a list of ranges containing character numeric values; each range is a Set::IntRange object.
Returns, as a string, the code of the subroutine you can use to implement your custom character properties.
Takes an optional string argument; this is used for the subroutine name. Note that according to perlunicode the subroutine name has to start with In or Is. If this argument is omitted, a dummy name - InFoo - is used.
In
Is
InFoo
See perlmodinstall for information and options on installing Perl modules.
No bugs have been reported.
Please report any bugs or feature requests through the web interface at http://rt.cpan.org/Public/Dist/Display.html?Name=Sub-CharacterProperties.
The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Visit http://www.perl.com/CPAN/ to find a CPAN site near you, or see http://search.cpan.org/dist/Sub-CharacterProperties/.
The development version lives at http://github.com/hanekomu/Sub-CharacterProperties/. Instead of sending patches, please fork this project using the standard git and github infrastructure.
Marcel Gruenauer <marcel@cpan.org>
This software is copyright (c) 2007 by Marcel Gruenauer.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Sub::CharacterProperties, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sub::CharacterProperties
CPAN shell
perl -MCPAN -e shell install Sub::CharacterProperties
For more information on module installation, please visit the detailed CPAN module installation guide.