ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Net-IRC3/README
Revision: 1.3
Committed: Sun Jul 16 11:11:17 2006 UTC (20 years, 2 months ago) by elmex
Branch: MAIN
Changes since 1.2: +47 -96 lines
Log Message:
version 0.2. added documentation and refactored code a bit.

File Contents

# Content
1 NAME
2 Net::IRC3 - An IRC Protocol module which is event system independend
3
4 VERSION
5 Version 0.2
6
7 SYNOPSIS
8 use Net::IRC3;
9
10 my $irc3 = new Net::IRC3;
11
12 my $con = $irc3->connect ("test.not.at.irc.net", 6667);
13
14 ...
15
16 DESCRIPTION
17 Net::IRC3 itself is a simple building block for an IRC client. It
18 manages connections and parses and constructs IRC messages.
19
20 Net::IRC3 is *very* simple, if you don't want to care about all the
21 other things that a client still has to do (like replying to PINGs and
22 remembering who is on a channel), I recommend to read the
23 Net::IRC3::Client page instead.
24
25 METHODS
26 new ()
27 This just creates a Net::IRC3 object, which is a management class
28 for creating and managing connections.
29
30 connect ($host, $port)
31 Tries to open a socket to the host $host and the port $port. If
32 successfull it will return a Net::IRC3::Connection object. If an
33 error occured it will die (use eval to catch the exception).
34
35 connections ()
36 Returns a key value list, where the key is "$host:$port" and the
37 value is the connection object. Only 'active' connections are
38 returned. That means, if a connection is terminated somehow, it will
39 also disappear from this list.
40
41 connection ($host, $port) or connection ("$host:$port")
42 Returns the Net::IRC3::Connection object for the $host $port pair.
43 If no such connection exists, undef is returned.
44
45 FUNCTIONS
46 These are some utility functions that might come in handy when handling
47 the IRC protocol.
48
49 You can export these with eg.:
50
51 use Net::IRC3 qw/parse_irc_msg/;
52
53 parse_irc_msg ($ircline)
54 This method parses the $ircline, which is one line of the IRC
55 protocol without the trailing "\015\012".
56
57 It returns a hash which has the following entrys:
58
59 prefix
60 The message prefix.
61
62 command
63 The IRC command.
64
65 params
66 The parameters to the IRC command in a array reference, this
67 includes the trailing parameter (the one after the ':' or the
68 14th parameter).
69
70 trailing
71 This is set if there was a trailing parameter (the one after the
72 ':' or the 14th parameter).
73
74 mk_msg ($prefix, $command, $trailing, @params)
75 This function assembles a IRC message. The generated message will
76 look like (pseudo code!)
77
78 :<prefix> <command> <params> :<trail>
79
80 Please refer to RFC 2812 how IRC messages normally look like.
81
82 The prefix and the trailing string will be omitted if they are
83 "undef".
84
85 EXAMPLES:
86
87 mk_msg (undef, "PRIVMSG", "you suck!", "magnus");
88 # will return: "PRIVMSG magnus :you suck!\015\012"
89
90 mk_msg (undef, "JOIN", undef, "#test");
91 # will return: "JOIN #magnus\015\012"
92
93 split_prefix ($prefix)
94 This function splits an IRC user prefix as described by RFC 2817
95 into the three parts: nickname, user and host. Which will be
96 returned as a list with that order.
97
98 $prefix can also be a hash like it is returned by "parse_irc_msg".
99
100 prefix_nick ($prefix)
101 A shortcut to extract the nickname from the $prefix.
102
103 $prefix can also be a hash like it is returned by "parse_irc_msg".
104
105 prefix_user ($prefix)
106 A shortcut to extract the username from the $prefix.
107
108 $prefix can also be a hash like it is returned by "parse_irc_msg".
109
110 prefix_host ($prefix)
111 A shortcut to extract the hostname from the $prefix.
112
113 $prefix can also be a hash like it is returned by "parse_irc_msg".
114
115 EXAMPLES
116 See the samples/ directory for some examples on how to use Net::IRC3.
117
118 AUTHOR
119 Robin Redeker, "<elmex@ta-sa.org>"
120
121 SEE ALSO
122 Net::IRC3::Connection
123
124 Net::IRC3::Client
125
126 RFC 2812 - Internet Relay Chat: Client Protocol
127
128 BUGS
129 Please report any bugs or feature requests to "bug-net-irc3 at
130 rt.cpan.org", or through the web interface at
131 <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-IRC3>. I will be
132 notified, and then you'll automatically be notified of progress on your
133 bug as I make changes.
134
135 SUPPORT
136 You can find documentation for this module with the perldoc command.
137
138 perldoc Net::IRC3
139
140 You can also look for information at:
141
142 * AnnoCPAN: Annotated CPAN documentation
143 <http://annocpan.org/dist/Net-IRC3>
144
145 * CPAN Ratings
146 <http://cpanratings.perl.org/d/Net-IRC3>
147
148 * RT: CPAN's request tracker
149 <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-IRC3>
150
151 * Search CPAN
152 <http://search.cpan.org/dist/Net-IRC3>
153
154 ACKNOWLEDGEMENTS
155 Thanks to Marc Lehmann for the new AnyEvent module!
156
157 COPYRIGHT & LICENSE
158 Copyright 2006 Robin Redker, all rights reserved.
159
160 This program is free software; you can redistribute it and/or modify it
161 under the same terms as Perl itself.
162