Assuming this is just against flags() then can you try the following
patch?
diff --git a/lib/Mail/IMAPClient.pm b/lib/Mail/IMAPClient.pm
index d3a034a..8897728 100644
--- a/lib/Mail/IMAPClient.pm
+++ b/lib/Mail/IMAPClient.pm
@@ -2207,13 +2207,13 @@ sub flags {
$msg->cat(@_) if @_;
# Send command
- $self->fetch( $msg, "FLAGS" ) or return undef;
+ my $ref = $self->fetch( $msg, "FLAGS" ) or return undef;
my $u_f = $self->Uid;
my $flagset = {};
# Parse results, setting entry in result hash for each line
- foreach my $line ( $self->Results ) {
+ foreach my $line ( @$ref ) {
$self->_debug("flags: line = '$line'");
if (
$line =~ /\* \s+ (\d+) \s+ FETCH \s+ # * nnn FETCH