| Previous | Next
Net::CmdThe network command class, which is required by all of the modules under the libnet umbrella: Net::FTP, Net::SMTP, Net::POP3, etc. In addition, Net::Cmd can be inherited by a subclass of IO::Handle. Unless you are writing a new module that will become a part of libnet, Net::Cmd probably doesn't have any servicable parts that you'd be interested in, since these parts are already implemented in the underlying modules. This module is part of the core Perl distribution starting with Perl 5.8. Net::Cmd implements the following methods, which provide an interface to the Net::Cmd object.
code() Returns the three-digit code from the last command. If the last command is still pending,
dataend() Stops sending data to the remote server and ensures that a final CRLF has been sent.
datasend(data) Sends data to the remote server, converting LF to CRLF.
debug(level) Sets the debug level for the object. If you do not specify a value, then no debugging information will be provided. If you specify
message() Returns a text message from the last command.
ok() Returns nonzero if the last code value was greater than 0 and less than 400.
status() Returns the current status code and, if pending, returns Net::Cmd implements the following class methods, which you should probably never touch at a user level.
command(command, [, args, ...]) Sends a command to the remote server. Returns
debug_print(dir, text) Outputs debugging information. dirrepresents data sent to the server, and
debug_text(text) Prints debugging information.
getline() Retrieves one line, delimited by CRLF, from the remote server. Returns
parse_response(text) Returns an array of two values: the three-digit status code and a flag that is true when this is part of a multiline response. Called by
read_until_dot() Reads data from the remote server until a line consisting of a single is encountered. If the line matches , one of the dots will be removed. Returns a reference to a list containing the lines or
response() Obtains a response from the server. On success, it returns the status code, or
tied_fh() Returns a filehandle tied to the Net::Cmd object. After you send a command, you can read from this filehandle with
ungetline(text) Pushes back a line of text from the server.
unsupported() Sets the status code to and the response to Net::Cmd exports |