IRC::Toolkit::Role::CaseMap - Role for classes that track IRC casemapping
package MyIRC; use Moo; has casemap => ( is => 'rw', default => sub { 'rfc1459' }, coerce => sub { lc $_[0] }, ); with 'IRC::Toolkit::Role::CaseMap'; sub mymeth { my ($self, $nickname, $one, $two) = @_; my $lowered = $self->lower( $nickname ); my $uppered = $self->upper( $nickname ); if ( $self->equal( $one, $two ) ) { ... } }
A Role::Tiny role that provides convenient helper methods for classes that track IRC casemapping, such as IRC client libraries.
This role requires a casemap attribute that returns one of 'rfc1459', 'ascii', or 'strict-rfc1459' -- see IRC::Toolkit::Case for details on IRC casemap issues.
requires
Returns the IRC-lowercased string.
Returns the IRC-uppercased string.
Expects two strings; returns true if they are equal per the current casemap rules. Returns empty list if the strings do not match.
Jon Portnoy <avenj@cobaltirc.org>
To install IRC::Toolkit, copy and paste the appropriate command in to your terminal.
cpanm
cpanm IRC::Toolkit
CPAN shell
perl -MCPAN -e shell install IRC::Toolkit
For more information on module installation, please visit the detailed CPAN module installation guide.