Subject: | last_error gives undef warning |
Date: | Thu, 04 Sep 2014 12:05:47 -0700 |
To: | bug-Net-IMAP-Client [...] rt.cpan.org |
From: | Peter Scott <Peter [...] PSDT.com> |
It used to be possible to call last_error to see if there had been an
error without triggering a warning; now it gives
Use of uninitialized value in substitution (s///) at /usr/local/lib/perl5/site_perl/5.18.1/Net/IMAP/Client.pm line 598.
if there has not actually been an error. This is due to:
$self->{_error} =~ s/\s+$//s; # remove trailing carriage return
Suggest adding before that:
defined $self->{_error} or return;