* Parse NICK.

* Do not import API::IRC subroutines to Parser::IRC, instead use the class.
* Added usrc() to API::IRC for formatting a source.
This commit is contained in:
Elijah Perrault committed 2011-01-20 21:46:43 -07:00
1 parent e872082eb9
commit 512c351577
3 files changed
+44 -10

No files matched your search

+17 -1
View File
@@ -9,7 +9,7 @@ use warnings;
use Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(cjoin cpart cmode privmsg notice quit nick);
our @EXPORT_OK = qw(cjoin cpart cmode privmsg notice quit nick usrc);
# Join a channel.
@@ -91,3 +91,19 @@ sub quit
delete $Parser::IRC::botnick{$svr} if (defined $Parser::IRC::botnick{$svr});
}
# Get nick, ident and host from a <nick>!<ident>@<host>
sub usrc
{
my ($ex) = @_;
my @si = split('!', $ex);
my @sii = split('@', $si[1]);
return (
nick => $si[0],
ident => $si[1],
host => $sii[1]
);
}