IO::Socket::CLI - CLI for IO::Socket::INET6 and IO::Socket::SSL
use IO::Socket::CLI; @ISA = ("IO::Socket::CLI");
Creates a new IO::Socket::CLI object, returning its reference. Has the following options:
Hostname or IP address. Default is
Port of the service. Default is
Boolean value for if an SSL connection. Default is
String server sends when it hangs up. Default is
qr'^\* BYE( |\r?$)'.
Timeout in seconds for reading from the socket before returning an empty list. Default is
Delay in milliseconds between read attempts if nothing is returned. Default is
Boolean value for if to automatically print the server response on "read()". Default is
Boolean value for if to pretend client commands and server responses with
"C: " and
"S: ", respectively. Default is
Boolean value for if to give verbose debugging info. Default is
Reads the response from the server, returning it as a list. Tries every
DELAY milliseconds until
TIMEOUT seconds. Optionally prints the response to
Returns the last stored response from the server as a list.
Prints each line of server response to
STDOUT, optionally prepending with
"S: " if
Returns if the server hung up according to the last server response.
$command to the server. Optionally echoes
Reads command from
STDIN and sends it to the server.
Returns last command sent.
PRINT_RESPONSE on/off. Returns value.
PREPEND on/off. Returns value.
TIMEOUT in seconds. Must be non-negative. Returns value.
DELAY in milliseconds. Must be positive. Returns value.
BYE. Must be a regexp-like quote:
qr/STRING/. Returns value.
Optionally turns debugging info/verbosity on/off. Returns value.
Returns the underlying socket.
errstr() from the socket. Only for SSL - returns
Closes the socket. Returns true on success. This method needs to be overridden for SSL connections.
Does not verify SSL connections. Has not been tried with STARTTLS.
Copyright (C) 2012 by Ashley Willis <firstname.lastname@example.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.12.4 or, at your option, any later version of Perl 5 you may have available.