Scroll to navigation

AnyEvent::FTP::Response(3pm) User Contributed Perl Documentation AnyEvent::FTP::Response(3pm)

NAME

AnyEvent::FTP::Response - Response class for asynchronous ftp client

VERSION

version 0.20

DESCRIPTION

Instances of this class represent a FTP server response.

ATTRIBUTES

code

 my $code = $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.

message

 my $message = $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

is_success

 my $bool = $res->is_success;

True if the response does not represent an error condition (codes "1xx", "2xx" or "3xx").

is_preliminary

 my $bool = $res->is_preliminary;

True if the response is a preliminary positive reply (code "1xx").

as_string

 my $str = $res->as_string;
 my $str = "$res";

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

Author: Graham Ollis <plicease@cpan.org>

Contributors:

Ryo Okamoto

Shlomi Fish

José Joaquín Atria

COPYRIGHT AND LICENSE

This software is copyright (c) 2017-2022 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.

2026-02-16 perl v5.40.1