Subject: | Throws warnings at compile time if running with 'perl -w' |
Hi,
We received the following bug report in Debian:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=450955
Note that the warnings only get shown if running with the -w switch -
"use warnings" does not trigger it.
Now, besides the warning itself, the module will probably break at
execution time if debugging to a handle, as it seems (to me at least)
that 'write' was specified instead of 'print' - Looking at 'perldoc -f
write', it does _not_ accept multi-argument invocations - If using write
to fill in formats, it should be called with only the output filehandle.
I think you wanted to use 'print' instead.
So, here is my fix for it. Please comment on it --- I do not want to
blindly push a fix that I might not really understand.
Index: lib/Net/IMAP/Simple.pm
===================================================================
--- lib/Net/IMAP/Simple.pm (revision 10046)
+++ lib/Net/IMAP/Simple.pm (working copy)
@@ -898,9 +898,9 @@
$str =~ s/\r/\\r/g;
$str =~ s/\cM/^M/g;
- my $line = "[$package :: $filename :: $line\@$dline -> $routine] $str\n";
+ $line = "[$package :: $filename :: $line\@$dline -> $routine] $str\n";
if(ref($self->{debug}) eq 'GLOB'){
- write($self->{debug}, $line);
+ print $self->{debug} $line;
} else {
print STDOUT $line;
}