Net::Async::IRC::Message - encapsulates a single IRC message
An object in this class represents a single IRC message, either received from or to be sent to the server. These objects are immutable once constructed, but provide a variety of methods to access the contained information.
Returns a new
Net::Async::IRC::Message object, constructed by parsing the given IRC line. Most typically used to create a new object to represent a message received from the server.
Returns a new
Net::Async::IRC::Message object, intialised from the given components. Most typically used to create a new object to send to the server using
Returns a string representing the message, suitable for use in a debugging message or similar. Note: This is not the same as the IRC wire form, to send to the IRC server; for that see
Returns the command name stored in the message object.
Returns the line prefix stored in the object, or the empty string if one was not supplied.
Splits the prefix into its nick, ident and host components. If the prefix contains only a hostname (such as the server name), the first two components will be returned as
Returns the argument at the given index. Uses normal perl array indexing, so negative indices work as expected.
Returns a list containing all the message arguments.
Returns a string suitable for sending the message to the IRC server.
Returns a hash giving details on how to parse named arguments for the command given in this message.
This will be a hash whose keys give the names of the arguments, and the values of these keys indicate how that argument is derived from the simple positional arguments.
Normally this method is only called internally by the
named_args method, but is documented here for the benefit of completeness, and in case extension modules wish to define parsing of new message types.
Each value should be one of the following:
The value is a string, the nickname given in the message prefix
The value is an ARRAY ref, containing a list of all the numbered arguments between the (inclusive) given limits. Either or both limits may be negative; they will count backwards from the end.
The value is the argument at that numeric index. May be negative to count backwards from the end.
The value is the argument at that numeric index as for
NUMBER, except that the result will be split on spaces and stored in an ARRAY ref.
Parses arguments in the message according to the specification given by the
arg_names method. Returns a hash of parsed arguments.
TODO: More complete documentation on the exact arg names/values per message type.
Paul Evans <firstname.lastname@example.org>