<P>This method sends the TELNET break character. This character is
provided because it's a signal outside the USASCII character set which
is currently given local meaning within many systems. It's intended
to indicate that the Break Key or the Attention Key was hit.</P>
</DL>
<DL>
<DT><STRONG><A NAME="item_buffer_%2D_scalar_reference_to_object%27s_input_bu"><STRONG>buffer</STRONG> - scalar reference to object's input buffer</A></STRONG><BR>
<DD>
<PRE>
$ref = $obj->buffer;</PRE>
<P>This method returns a scalar reference to the input buffer for
<EM>$obj</EM>. Data in the input buffer is data that has been read from the
remote side but has yet to be read by the user. Modifications to the
input buffer are returned by a subsequent read.</P>
</DL>
<DL>
<DT><STRONG><A NAME="item_buffer_empty_%2D_discard_all_data_in_object%27s_in"><STRONG>buffer_empty</STRONG> - discard all data in object's input buffer</A></STRONG><BR>
<DD>
<PRE>
$obj->buffer_empty;</PRE>
<P>This method removes all data in the input buffer for <EM>$obj</EM>.</P>
</DL>
<DL>
<DT><STRONG><A NAME="item_close_%2D_close_object"><STRONG>close</STRONG> - close object</A></STRONG><BR>
<DD>
<PRE>
$ok = $obj->close;</PRE>
<P>This method closes the socket, file, or pipe associated with the
object.</P>
</DL>
<DL>
<DT><STRONG><A NAME="item_cmd_%2D_issue_command_and_retrieve_output"><STRONG>cmd</STRONG> - issue command and retrieve output</A></STRONG><BR>
<DD>
<PRE>
$ok = $obj->cmd($string);
$ok = $obj->cmd(String => $string,
[Output => $ref,]
[Prompt => $match,]
[Timeout => $secs,]
[Cmd_remove_mode => $mode,]);</PRE>
<PRE>
@output = $obj->cmd($string);
@output = $obj->cmd(String => $string,
[Output => $ref,]
[Prompt => $match,]
[Timeout => $secs,]
[Cmd_remove_mode => $mode,]);</PRE>
<P>This method sends the command <EM>$string</EM>, and reads the characters
sent back by the command up until and including the matching prompt.
It's assumed that the program to which you're sending is some kind of
command prompting interpreter such as a shell.</P>
<P>In a scalar context the characters read are discarded and a boolean is
returned indicating the success or failure of sending the command
string and reading the prompt. Note that in order to return on error,
<CODE>errmode()</CODE> must not be set to <CODE>"die"</CODE>.</P>
<P>In an array context, just the output generated by the command is
returned, one line per element. In other words, all the characters in
between the echoed back command string and the prompt are returned.
If the command happens to return no output, an array containing one
element, the null string is returned. This is so the array will
indicate true in a boolean context.</P>
<P>Many command interpreters echo back the command sent. In most
situations, this method removes the first line returned from the
remote side (i.e. the echoed back command). See <CODE>cmd_remove_mode()</CODE>
for more control over this feature.</P>
<P>Use <CODE>dump_log()</CODE> to debug when this method keeps timing-out and you
don't think it should.</P>
<P>Optional named arguments are provided to override the current settings
of prompt, timeout, and cmd_remove_mode.</P>
<P>The <EM>Output</EM> named argument provides an alternative method of
receiving command output. If you pass a scalar reference, all the
output (even if it contains multiple lines) is returned in the
referenced scalar. If you pass an array or hash reference, the lines
of output are returned in the referenced array or hash.</P>
</DL>
<DL>
<DT><STRONG><A NAME="item_cmd_remove_mode_%2D_toggle_removal_of_echoed_comma"><STRONG>cmd_remove_mode</STRONG> - toggle removal of echoed commands</A></STRONG><BR>
<DD>
<PRE>
$mode = $obj->cmd_remove_mode;</PRE>
<PRE>
$prev = $obj->cmd_remove_mode($mode);</PRE>
<P>This method controls how to deal with echoed back commands in the
output returned by cmd(). Typically, when you send a command to the
remote side, the first line of output returned is the command echoed
back. Use this mode to remove the first line of output normally
returned by cmd().</P>
<P>If no argument is given, the current mode is returned.</P>
<P>If <EM>$mode</EM> is <CODE>0</CODE> then the command output returned from <CODE>cmd()</CODE> has no
lines removed. If <EM>$mode</EM> is a positive integer, then the first
<EM>$mode</EM> lines of command output are stripped.</P>
<P>By default, <EM>$mode</EM> is set to <CODE>"auto"</CODE>. Auto means that whether or
not the first line of command output is stripped, depends on whether
or not the remote side offered to echo. By default, Net::Telnet
always accepts an offer to echo by the remote side. You can change
the default to reject such an offer using <CODE>option_accept()</CODE>.</P>
</DL>
<DL>
<DT><STRONG><A NAME="item_dump_log_%2D_log_all_I%2FO_in_dump_format"><STRONG>dump_log</STRONG> - log all I/O in dump format</A></STRONG><BR>
<DD>
<PRE>
$fh = $obj->dump_log;</PRE>
<PRE>
$fh = $obj->dump_log($fh);</PRE>
<PRE>
$fh = $obj->dump_log($filename);</PRE>
<P>This method starts or stops dump format logging of all the object's
input and output. The dump format shows the blocks read and written
in a hexadecimal and printable character format. This method is
useful when debugging, however you might want to first try
<CODE>input_log()</CODE> as it's more readable.</P>
<P>If no argument is given, the current log filehandle is returned. A
null string indicates logging is off.</P>
<P>To stop logging, use a null string as an argument.</P>
<P>If an open filehandle is given, it is used for logging and returned.
Otherwise, the argument is assumed to be the name of a file, the file
is opened and a filehandle to it is returned.</P>
</DL>
<DL>
<DT><STRONG><A NAME="item_eof_%2D_end_of_file_indicator"><STRONG>eof</STRONG> - end of file indicator</A></STRONG><BR>
<DD>
<PRE>
$eof = $obj->eof;</PRE>
<P>This method indicates if end of file has been read. Because the input
is buffered this isn't the same thing as <EM>$obj</EM> has closed. In other
words <EM>$obj</EM> can be closed but there still can be stuff in the buffer
to be read. Under this condition you can still read but you won't be
able to write.</P>
</DL>
<DL>
<DT><STRONG><A NAME="item_errmode_%2D_define_action_to_be_performed_on_error"><STRONG>errmode</STRONG> - define action to be performed on error</A></STRONG><BR>
<DD>
<PRE>
$mode = $obj->errmode;</PRE>
<PRE>
$prev = $obj->errmode($mode);</PRE>
<P>This method gets or sets the action used when errors are encountered
using the object. The first calling sequence returns the current
error mode. The second calling sequence sets it to <EM>$mode</EM> and
returns the previous mode. Valid values for <EM>$mode</EM> are <CODE>"die"</CODE>
(the default), <CODE>"return"</CODE>, a <EM>coderef</EM>, or an <EM>arrayref</EM>.</P>
<P>When mode is <CODE>"die"</CODE> and an error is encountered using the object,
then an error message is printed to standard error and the program
dies.</P>
<P>When mode is <CODE>"return"</CODE> then the method generating the error places
an error message in the object and returns the undefined value in a
scalar context and a null list in list context. The error message may
be obtained using <CODE>errmsg()</CODE>.</P>
<P>When mode is a <EM>coderef</EM>, then when an error is encountered
<EM>coderef</EM> is called with the error message as its first argument.
Using this mode you may have your own subroutine handle errors. If
<EM>coderef</EM> itself returns then the method generating the error returns
undefined or a null list depending on context.</P>
<P>When mode is an <EM>arrayref</EM>, the first element of the array must be a
<EM>coderef</EM>. Any elements that follow are the arguments to <EM>coderef</EM>.
When an error is encountered, the <EM>coderef</EM> is called with its
arguments. Using this mode you may have your own subroutine handle
errors. If the <EM>coderef</EM> itself returns then the method generating
the error returns undefined or a null list depending on context.</P>
</DL>
<DL>
<DT><STRONG><A NAME="item_errmsg_%2D_most_recent_error_message"><STRONG>errmsg</STRONG> - most recent error message</A></STRONG><BR>
<DD>
<PRE>
$msg = $obj->errmsg;</PRE>
<PRE>
$prev = $obj->errmsg(@msgs);</PRE>
<P>The first calling sequence returns the error message associated with
the object. The null string is returned if no error has been
encountered yet. The second calling sequence sets the error message
for the object to the concatenation of <EM>@msgs</EM> and returns the
previous error message. Normally, error messages are set internally
by a method when an error is encountered.</P>
</DL>
<DL>
<DT><STRONG><A NAME="item_error_%2D_perform_the_error_mode_action"><STRONG>error</STRONG> - perform the error mode action</A></STRONG><BR>
<DD>
<PRE>
$obj->error(@msgs);</PRE>
<P>This method concatenates <EM>@msgs</EM> into a string and places it in the
object as the error message. Also see <CODE>errmsg()</CODE>. It then performs
the error mode. Also see <CODE>errmode()</CODE>.</P>
<P>If the error mode doesn't cause the program to die then the undefined
value or a null list is returned depending on context.</P>
<P>This method is primarily used by this class or a sub-class to perform
the user requested action when an error is encountered.</P>
</DL>
<DL>
<DT><STRONG><A NAME="item_fhopen_%2D_use_already_open_filehandle_for_I%2FO"><STRONG>fhopen</STRONG> - use already open filehandle for I/O</A></STRONG><BR>
<DD>
<PRE>
$ok = $obj->fhopen($fh);</PRE>
<P>This method associates the open filehandle <EM>$fh</EM> with <EM>$obj</EM> for
further I/O. Filehandle <EM>$fh</EM> must already be opened.</P>
<P>Suppose you want to use the features of this module to do I/O to
something other than a TCP port, for example STDIN or a filehandle
opened to read from a process. Instead of opening the object for I/O
to a TCP port by using <A HREF="../../../lib/Pod/perlfunc.html#item_open"><CODE>open()</CODE></A> or <CODE>new()</CODE>, call this method
instead.</P>
</DL>
<DL>
<DT><STRONG><A NAME="item_get_%2D_read_block_of_data"><STRONG>get</STRONG> - read block of data</A></STRONG><BR>
<DD>
<PRE>
$data = $obj->get([Timeout => $secs,]);</PRE>
<P>This method reads a block of data from the object and returns it along
with any buffered data. If no buffered data is available to return,
it will wait for data to read using the timeout specified in the
object. You can override that timeout using <EM>$secs</EM>. Also see
<CODE>timeout()</CODE>. If buffered data is available to return, it also checks
for a block of data that can be immediately read.</P>
<P>On eof an undefined value is returned. On time-out or other errors
the error mode action is performed.</P>
<P>An undefined value is returned for both eof and time-out when
<EM>errmode</EM> is not set to <CODE>"die"</CODE>. Use <A HREF="../../../lib/Pod/perlfunc.html#item_eof"><CODE>eof()</CODE></A> and <CODE>timed_out()</CODE> to
distinguish.</P>
</DL>
<DL>
<DT><STRONG><A NAME="item_getline_%2D_read_next_line"><STRONG>getline</STRONG> - read next line</A></STRONG><BR>
<DD>
<PRE>
$line = $obj->getline([Timeout => $secs,]);</PRE>
<P>This method reads and returns the next line of data from the object.
You can use <A HREF="../../../lib/Pod/perlvar.html#item_input_record_separator"><CODE>input_record_separator()</CODE></A> to change the notion of what
separates a line. The default is <CODE>"\n"</CODE>.</P>
<P>If a line isn't immediately available, this method blocks waiting for
a line or the timeout. You can override the object's timeout for this
method using <EM>$secs</EM>. Also see <CODE>timeout()</CODE>.</P>
<P>On eof an undefined value is returned. On timeout or other errors the
error mode action is performed.</P>
<P>An undefined value is returned for both eof and time-out when
<EM>errmode</EM> is not set to <CODE>"die"</CODE>. Use <A HREF="../../../lib/Pod/perlfunc.html#item_eof"><CODE>eof()</CODE></A> and <CODE>timed_out()</CODE> to
distinguish.</P>
</DL>
<DL>
<DT><STRONG><A NAME="item_getlines_%2D_read_next_lines"><STRONG>getlines</STRONG> - read next lines</A></STRONG><BR>
<P>This method reads and returns the next available lines of data from
the object. You can use <A HREF="../../../lib/Pod/perlvar.html#item_input_record_separator"><CODE>input_record_separator()</CODE></A> to change the
notion of what separates a line. The default is <CODE>"\n"</CODE>.</P>
<P>If a line isn't immediately available, this method blocks waiting for
one or more lines, or the timeout. You can override the object's
timeout for this method using <EM>$secs</EM>. Also see <CODE>timeout()</CODE>.</P>
<P>On eof a null array is returned. On timeout or other errors the error
mode action is performed.</P>
<P>A null array is returned for both eof and time-out when <EM>errmode</EM> is
not set to <CODE>"die"</CODE>. Use <A HREF="../../../lib/Pod/perlfunc.html#item_eof"><CODE>eof()</CODE></A> and <CODE>timed_out()</CODE> to distinguish.</P>
</DL>
<DL>
<DT><STRONG><A NAME="item_host_%2D_name_of_remote_host"><STRONG>host</STRONG> - name of remote host</A></STRONG><BR>
<DD>
<PRE>
$host = $obj->host;</PRE>
<PRE>
$prev = $obj->host($host);</PRE>
<P>This method designates the remote host. With no argument this method
returns the current host name set in the object. With an argument it
sets the current host name to <EM>$host</EM> and returns the previous host
name. You may indicate the remote host using either a hostname or an
IP address.</P>
</DL>
<DL>
<DT><STRONG><A NAME="item_input_log_%2D_log_all_input"><STRONG>input_log</STRONG> - log all input</A></STRONG><BR>
<DD>
<PRE>
$fh = $obj->input_log;</PRE>
<PRE>
$fh = $obj->input_log($fh);</PRE>
<PRE>
$fh = $obj->input_log($filename);</PRE>
<P>This method starts or stops logging of input. This is useful when
debugging. Also see <CODE>dump_log()</CODE>. Because most command interpreters
echo back commands received, its likely all your output will also be
in this log. Note that input logging occurs after newline
translation. See <A HREF="../../../lib/Pod/perlfunc.html#item_binmode"><CODE>binmode()</CODE></A> for details on newline translation.</P>
<P>If no argument is given, the log filehandle is returned. A null
string indicates logging is off.</P>
<P>To stop logging, use a null string as an argument.</P>
<P>If an open filehandle is given, it is used for logging and returned.
Otherwise, the argument is assumed to be the name of a file, the file
is opened for logging and a filehandle to it is returned.</P>
</DL>
<DL>
<DT><STRONG><A NAME="item_input_record_separator_%2D_input_line_delimiter"><STRONG>input_record_separator</STRONG> - input line delimiter</A></STRONG><BR>
<DD>
<PRE>
$rs = $obj->input_record_separator;</PRE>
<PRE>
$prev = $obj->input_record_separator($rs);</PRE>
<P>This method designates the line delimiter for input. It's used with
<CODE>getline()</CODE>, <CODE>getlines()</CODE>, and <CODE>cmd()</CODE> to determine lines in the
input.</P>
<P>With no argument this method returns the current input record
separator set in the object. With an argument it sets the input
record separator to <EM>$rs</EM> and returns the previous value.</P>
</DL>
<DL>
<DT><STRONG><A NAME="item_lastline_%2D_last_line_read"><STRONG>lastline</STRONG> - last line read</A></STRONG><BR>
<DD>
<PRE>
$line = $obj->lastline;</PRE>
<PRE>
$prev = $obj->lastline($line);</PRE>
<P>This method saves the last line read from the object. This may be a
useful error message when the remote side abnormally closes the
connection. Typically the remote side will print an error message
before closing.</P>
<P>With no argument this method returns the last line read from the
object. With an argument it sets the last line read to <EM>$line</EM> and
returns the previous value. Normally, only internal methods set the
last line.</P>
</DL>
<DL>
<DT><STRONG><A NAME="item_login_%2D_perform_standard_login"><STRONG>login</STRONG> - perform standard login</A></STRONG><BR>
<DD>
<PRE>
$ok = $obj->login($username, $password);</PRE>
<PRE>
$ok = $obj->login(Name => $username,
Password => $password,
[Prompt => $match,]
[Timeout => $secs,]);</PRE>
<P>This method performs a standard login by waiting for a login prompt
and responding with <EM>$username</EM>, then waiting for the password prompt
and responding with <EM>$password</EM>, and then waiting for the command
interpreter prompt. If any of those prompts sent by the remote side
don't match what's expected, this method will timeout - unless timeout
is turned off.</P>
<P>Login prompts must match either of the patterns:</P>
<PRE>
/login[: ]*$/i
/username[: ]*$/i</PRE>
<P>Password prompts must match the pattern:</P>
<PRE>
/password[: ]*$/i</PRE>
<P>The command interpreter prompt must match the current setting of
prompt.</P>
<P>Use <CODE>dump_log()</CODE> to debug when this method keeps timing-out and you
don't think it should.</P>
<P>Optional named arguments are provided to override the current settings
of prompt and timeout.</P>
</DL>
<DL>
<DT><STRONG><A NAME="item_max_buffer_length_%2D_maximum_size_of_input_buffer"><STRONG>max_buffer_length</STRONG> - maximum size of input buffer</A></STRONG><BR>
<DD>
<PRE>
$len = $obj->max_buffer_length;</PRE>
<PRE>
$prev = $obj->max_buffer_length($len);</PRE>
<P>This method designates the maximum size of the input buffer. An error
is generated when a read causes the buffer to exceed this limit. The
default value is 1,048,576 bytes (1MB). The input buffer can grow
much larger than the block size when you continuously read using
<CODE>getline()</CODE> or <CODE>waitfor()</CODE> and the data stream contains no newlines
or matching waitfor patterns.</P>
<P>With no argument this method returns the current maximum buffer length
set in the object. With an argument it sets the maximum buffer length
to <EM>$len</EM> and returns the previous value.</P>
</DL>
<DL>
<DT><STRONG><A NAME="item_open_%2D_connect_to_port_on_remote_host"><STRONG>open</STRONG> - connect to port on remote host</A></STRONG><BR>
<DD>
<PRE>
$ok = $obj->open($host);</PRE>
<PRE>
$ok = $obj->open([Host => $host,]
[Port => $port,]
[Timeout => $secs,]);</PRE>
<P>This method opens a TCP connection to <EM>$port</EM> on <EM>$host</EM>. If either
argument is missing then the current value of <CODE>host()</CODE> or <CODE>port()</CODE>
is used. An optional named argument is provided to override the
current setting of timeout.</P>
<P>On time-out or other connection errors, the error mode action is
performed.</P>
<P>Timeouts don't work for this method on machines that don't implement
SIGALRM - most notably Win32 machines. For those machines, an error
is returned when the system reaches its own time-out while trying to
connect.</P>
<P>A side effect of this method is to reset the alarm interval associated
with SIGALRM.</P>
</DL>
<DL>
<DT><STRONG><A NAME="item_option_accept_%2D_indicate_willingness_to_accept_a"><STRONG>option_accept</STRONG> - indicate willingness to accept a TELNET option</A></STRONG><BR>
<DD>
<PRE>
$fh = $obj->option_accept([Do => $telopt,]
[Dont => $telopt,]
[Will => $telopt,]
[Wont => $telopt,]);</PRE>
<P>This method is used to indicate whether to accept or reject an offer
to enable a TELNET option made by the remote side. If you're using
<EM>Do</EM> or <EM>Will</EM> to indicate a willingness to enable, then a
notification callback must have already been defined by a prior call
to <CODE>option_callback()</CODE>. See <CODE>option_callback()</CODE> for details on
receiving enable/disable notification of a TELNET option.</P>
<P>You can give multiple <EM>Do</EM>, <EM>Dont</EM>, <EM>Will</EM>, or <EM>Wont</EM> arguments
for different TELNET options in the same call to this method.</P>
<P>The following example describes the meaning of the named arguments. A
TELNET option, such as <CODE>TELOPT_ECHO</CODE> used below, is an integer
constant that you can import from Net::Telnet. See the source in file
Telnet.pm for the complete list.</P>
<DL>
<DT><DD>
<EM>Do</EM> => <CODE>TELOPT_ECHO</CODE>
<DL>
<DT><DD>
we'll accept an offer to enable the echo option on the local side
<P></P></DL>
<DT><DD>
<EM>Dont</EM> => <CODE>TELOPT_ECHO</CODE>
<DL>
<DT><DD>
we'll reject an offer to enable the echo option on the local side
<P></P></DL>
<DT><DD>
<EM>Will</EM> => <CODE>TELOPT_ECHO</CODE>
<DL>
<DT><DD>
we'll accept an offer to enable the echo option on the remote side
<P></P></DL>
<DT><DD>
<EM>Wont</EM> => <CODE>TELOPT_ECHO</CODE>
<DL>
<DT><DD>
we'll reject an offer to enable the echo option on the remote side
<P></P></DL>
</DL>
<DT><DD>
Use <CODE>option_send()</CODE> to send a request to the remote side to enable or
disable a particular TELNET option.
<P></P></DL>
<DL>
<DT><STRONG><A NAME="item_option_callback_%2D_define_the_option_negotiation_"><STRONG>option_callback</STRONG> - define the option negotiation callback</A></STRONG><BR>
<DD>
<PRE>
$coderef = $obj->option_callback;</PRE>
<PRE>
$prev = $obj->option_callback($coderef);</PRE>
<P>This method defines the callback subroutine that's called when a
TELNET option is enabled or disabled. Once defined, the
<EM>option_callback</EM> may not be undefined. However, calling this method
with a different <EM>$coderef</EM> changes it.</P>
<P>Here are the circumstances that invoke <EM>$coderef</EM>:</P>
<DL>
<DT><DD>
An option becomes enabled because the remote side requested an enable
and <CODE>option_accept()</CODE> had been used to arrange that it be accepted.
<P></P>
<DT><DD>
The remote side arbitrarily decides to disable an option that is
currently enabled. Note that Net::Telnet always accepts a request to
disable from the remote side.
<P></P>
<DT><DD>
<CODE>option_send()</CODE> was used to send a request to enable or disable an
option and the response from the remote side has just been received.
Note, that if a request to enable is rejected then <EM>$coderef</EM> is
still invoked even though the option didn't change.
<P></P></DL>
<DT><DD>
Here are the arguments passed to <EM>&$coderef</EM>:
<PRE>
&$coderef($obj, $option, $is_remote,
$is_enabled, $was_enabled, $buf_position);</PRE>
<DL>
<DT><DD>
1. <EM>$obj</EM> is the Net::Telnet object
<P></P>
<DT><DD>
2. <EM>$option</EM> is the TELNET option. Net::Telnet exports constants
for the various TELNET options which just equate to an integer.
<P></P>
<DT><DD>
3. <EM>$is_remote</EM> is a boolean indicating for which side the option
applies.
<P></P>
<DT><DD>
4. <EM>$is_enabled</EM> is a boolean indicating the option is enabled or
disabled
<P></P>
<DT><DD>
5. <EM>$was_enabled</EM> is a boolean indicating the option was previously
enabled or disabled
<P></P>
<DT><DD>
6. <EM>$buf_position</EM> is an integer indicating the position in the
object's input buffer where the option takes effect. See <CODE>buffer()</CODE>
to access the object's input buffer.
<P></P></DL>
</DL>
<DL>
<DT><STRONG><A NAME="item_option_log_%2D_log_all_TELNET_options_sent_or_rece"><STRONG>option_log</STRONG> - log all TELNET options sent or received</A></STRONG><BR>
<DD>
<PRE>
$fh = $obj->option_log;</PRE>
<PRE>
$fh = $obj->option_log($fh);</PRE>
<PRE>
$fh = $obj->option_log($filename);</PRE>
<P>This method starts or stops logging of all TELNET options being sent
or received. This is useful for debugging when you send options via
<CODE>option_send()</CODE> or you arrange to accept option requests from the
remote side via <CODE>option_accept()</CODE>. Also see <CODE>dump_log()</CODE>.</P>
<P>If no argument is given, the log filehandle is returned. A null
string indicates logging is off.</P>
<P>To stop logging, use a null string as an argument.</P>
<P>If an open filehandle is given, it is used for logging and returned.
Otherwise, the argument is assumed to be the name of a file, the file
is opened for logging and a filehandle to it is returned.</P>
<P>This method is not yet implemented. Look for it in a future version.</P>
</DL>
<DL>
<DT><STRONG><A NAME="item_option_state_%2D_get_current_state_of_a_TELNET_opt"><STRONG>option_state</STRONG> - get current state of a TELNET option</A></STRONG><BR>
<DD>
<PRE>
$hashref = $obj->option_state($telopt);</PRE>
<P>This method returns a hashref containing a copy of the current state
of TELNET option <EM>$telopt</EM>.</P>
<P>Here are the values returned in the hash:</P>
<DL>
<DT><DD>
<EM>$hashref</EM>->{remote_enabled}
<DL>
<DT><DD>
boolean that indicates if the option is enabled on the remote side.
<P></P></DL>
<DT><DD>
<EM>$hashref</EM>->{remote_enable_ok}
<DL>
<DT><DD>
boolean that indicates if it's ok to accept an offer to enable this
option on the remote side.
<P></P></DL>
<DT><DD>
<EM>$hashref</EM>->{remote_state}
<DL>
<DT><DD>
string used to hold the internal state of option negotiation for this
option on the remote side.
<P></P></DL>
<DT><DD>
<EM>$hashref</EM>->{local_enabled}
<DL>
<DT><DD>
boolean that indicates if the option is enabled on the local side.
<P></P></DL>
<DT><DD>
<EM>$hashref</EM>->{local_enable_ok}
<DL>
<DT><DD>
boolean that indicates if it's ok to accept an offer to enable this
option on the local side.
<P></P></DL>
<DT><DD>
<EM>$hashref</EM>->{local_state}
<DL>
<DT><DD>
string used to hold the internal state of option negotiation for this
option on the local side.
<P></P></DL>
</DL>
</DL>
<DL>
<DT><STRONG><A NAME="item_output_field_separator_%2D_field_separator_for_pri"><STRONG>output_field_separator</STRONG> - field separator for print</A></STRONG><BR>
<DD>
<PRE>
$ofs = $obj->output_field_separator;</PRE>
<PRE>
$prev = $obj->output_field_separator($ofs);</PRE>
<P>This method designates the output field separator for <A HREF="../../../lib/Pod/perlfunc.html#item_print"><CODE>print()</CODE></A>.
Ordinarily the print method simply prints out the comma separated
fields you specify. Set this to specify what's printed between
fields.</P>
<P>With no argument this method returns the current output field
separator set in the object. With an argument it sets the output
field separator to <EM>$ofs</EM> and returns the previous value.</P>
</DL>
<DL>
<DT><STRONG><A NAME="item_output_log_%2D_log_all_output"><STRONG>output_log</STRONG> - log all output</A></STRONG><BR>
<DD>
<PRE>
$fh = $obj->output_log;</PRE>
<PRE>
$fh = $obj->output_log($fh);</PRE>
<PRE>
$fh = $obj->output_log($filename);</PRE>
<P>This method starts or stops logging of output. This is useful when
debugging. Also see <CODE>dump_log()</CODE>. Because most command interpreters
echo back commands received, its likely all your output would also be
in an input log. See <CODE>input_log()</CODE>. Note that output logging occurs
before newline translation. See <A HREF="../../../lib/Pod/perlfunc.html#item_binmode"><CODE>binmode()</CODE></A> for details on newline
translation.</P>
<P>If no argument is given, the log filehandle is returned. A null
string indicates logging is off.</P>
<P>To stop logging, use a null string as an argument.</P>
<P>If an open filehandle is given, it is used for logging and returned.
Otherwise, the argument is assumed to be the name of a file, the file
is opened for logging and a filehandle to it is returned.</P>
</DL>
<DL>
<DT><STRONG><A NAME="item_output_record_separator_%2D_output_line_delimiter"><STRONG>output_record_separator</STRONG> - output line delimiter</A></STRONG><BR>
<P>This method designates the remote TCP port. With no argument this
method returns the current port number. With an argument it sets the
current port number to <EM>$port</EM> and returns the previous port. If
<EM>$port</EM> is a service name, then first it's converted to a port number
using the perl function <A HREF="../../../lib/Pod/perlfunc.html#item_getservbyname"><CODE>getservbyname()</CODE></A>.</P>
</DL>
<DL>
<DT><STRONG><A NAME="item_print_%2D_write_to_object"><STRONG>print</STRONG> - write to object</A></STRONG><BR>
<DD>
<PRE>
$ok = $obj->print(@list);</PRE>
<P>This method prints a string or a comma-separated list of strings to
the opened object and returns non-zero if all data was successfully
written.</P>
<P>By default, the <A HREF="../../../lib/Pod/perlvar.html#item_output_record_separator"><CODE>output_record_separator()</CODE></A> is set to <CODE>"\n"</CODE> in order
to have your commands automatically end with a newline. In most cases
your output is being read by a command interpreter which won't accept
a command until newline is read. This is similar to someone typing a
command and hitting the return key.</P>
<P>On failure, it's possible that some data was written. If you choose
to try and recover from a print timing-out, use <CODE>print_length()</CODE> to
determine how much was written before time-out occurred.</P>
</DL>
<DL>
<DT><STRONG><A NAME="item_print_length_%2D_number_of_bytes_written_by_print"><STRONG>print_length</STRONG> - number of bytes written by print</A></STRONG><BR>
<DD>
<PRE>
$num = $obj->print_length;</PRE>
<P>This returns the number of bytes successfully written by the most