NAME

IRC::Toolkit::Masks - IRC mask-related utilities

SYNOPSIS

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 );

DESCRIPTION

IRC mask manipulation utilities derived from IRC::Utils.

matches_mask

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.

normalize_mask

Takes an IRC mask and returns the "normalized" version of the mask.

parse_user

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.

AUTHOR

Mask-matching and normalization code derived from IRC::Utils, copyright Chris Williams, HINRIK et al.

Jon Portnoy <avenj@cobaltirc.org>