AnyEve...esponse(3pm)

πŸ“¦ version 0.20, in ubuntu stonking

✨ AnyEvent::FTP::Response β€” bestie edition πŸ’…

okay so you're in AnyEvent::FTP::Response, which is a Perl module from the User Contributed Perl Documentation fam, and it's basically the little glow-up wrapper for a single FTP server response. πŸ¦‹

VERSION β€” version 0.20. slay. πŸŽ€


🌸 NAME 🌸

AnyEvent::FTP::Response β€” it's the response class for the asynchronous ftp client. periodt. πŸ’–


🌈 DESCRIPTION 🌈

So, like, instances of this class? They represent a FTP server response. that's it, that's the whole vibe. every time the server says something back to you, it gets wrapped up in one of these lil guys. πŸ‘‘


πŸŽ€ ATTRIBUTES πŸŽ€

🌟 code

my $code = $client->code;

It's the integer code for the message. and bestie, these codes have categories, here's the tea:

  • 1xx Positive preliminary reply
  • 2xx Positive completion reply
  • 3xx Positive intermediate reply
  • 4xx Transient negative reply
  • 5xx Permanent negative reply

So generally 4xx and 5xx messages are errors 😭 (big yikes energy), whereas 1xx and 3xx are various states of β€” at least so far β€” successful operations. and 2xx? that one indicates a completely successful operation. ate. πŸ”₯

🌟 message

my $message = $res->message;

The human readable message returned from the server. and this is always a list reference, even if the server only returned one line. one line, forty lines, doesn't matter, it's a list ref, no cap. πŸ’…


πŸ’œ METHODS πŸ’œ

⭐ is_success

my $bool = $res->is_success;

True if the response does not represent an error condition. that means codes 1xx, 2xx or 3xx. green flags only bestie πŸ’šβœ¨

⭐ is_preliminary

my $bool = $res->is_preliminary;

True if the response is a preliminary positive reply β€” that's code 1xx. it's giving "we're so back". πŸ™ˆ

⭐ as_string

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

Returns a string representation of the response. heads up though: this may not be exactly what was returned by the server, but it will include the code and at least part of the message in a human readable format. so like, the vibe of the message, translated for humans. 🫢

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;

literally identical, iykyk. 🌈


πŸ‘‘ AUTHOR πŸ‘‘

Author: Graham Ollis <plicease@cpan.org>

Contributors β€” the squad:

  • Ryo Okamoto
  • Shlomi Fish
  • JosΓ© JoaquΓ­n Atria

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. πŸ’œ

no gatekeeping here, it's free software fr fr.

and that's the whole page, bestie! this was AnyEve...esponse(3pm) as documented for perl v5.40.1, last touched 2026-02-16. mwah πŸ’‹ go forth and parse some FTP responses βœ¨πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from