IRC::Toolkit::Masks - IRC mask-related utilities
use IRC::Toolkit::Masks; my $mask = '*!avenj@*.cobaltirc.org'; my $full = 'avenj!avenj@eris.cobaltirc.org'; my $casemap = 'rfc1459'; if ( matches_mask($mask, $full, $casemap) ) { ... } my $bmask = normalize_mask( 'somenick' ); # somenick!*@* my $bmask = normalize_mask( 'user@host' ); # *!user@host my ($nick, $user, $host) = parse_user( $full ); my $nick = parse_user( $full );
IRC mask manipulation utilities derived from IRC::Utils.
Takes an IRC mask, a string to match it against, and an optional IRC casemap (see IRC::Toolkit::Case).
Returns boolean true if the match applies successfully.
Takes an IRC mask and returns the "normalized" version of the mask.
Splits an IRC mask into components.
Returns all available pieces (nickname, username, and host, if applicable) in list context.
Returns just the nickname in scalar context.
Mask-matching and normalization code derived from IRC::Utils, copyright Chris Williams, HINRIK et al.
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.