NAME
AnyEvent::FTP::Response - Response class for asynchronous ftp client
VERSION
version 0.01
DESCRIPTION
Instances of this class represent a FTP server response.
ATTRIBUTES
$client->code
Integer code for the message. These can be categorized thus:
- 1xx
-
Positive preliminary reply
- 2xx
-
Positive completion reply
- 3xx
-
Positive intermediate reply
- 4xx
-
Transient negative reply
- 5xx
-
Permanent negative reply
Generally 4xx
and 5xx
messages are errors, where as 1xx
, 3xx
are various states of (at least so far) successful operations. 2xx
indicates a completely successful operation.
$res->message
The human readable message returned from the server. This is always a list reference, even if the server only returned one line.
METHODS
$res->is_success
True if the response does not represent an error condition (codes 1xx
, 2xx
or 3xx
).
$res->is_preliminary
True if the response is a preliminary positive reply (code 1xx
).
$res->as_string
Returns a string representation of the response. This may not be exactly what was returned by the server, but will include the code and at least part of the message in a human readable format.
You can also get this string by treating objects of this class as a string (using it in a double quoted string, or by using string operators):
print "$res";
is the same as
print $res->as_string;
AUTHOR
Graham Ollis <plicease@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by Graham Ollis.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.