CC: | i.am.andrewo [...] gmail.com |
Subject: | Setting Input_log, Output_Log or Option_log to "" explicitly causes instantiation to fail |
Current code:
# perl -MNet::Telnet -MData::Dumper -E 'warn Dumper( Net::Telnet->new( -host => "127.0.0.1", Input_log => "" ) );'
Warning: something's wrong at -e line 1.
After the patch:
# perl -MNet::Telnet -MData::Dumper -E 'warn Dumper( Net::Telnet->new( -host => "127.0.0.1", Input_log => "" ) );'
$VAR1 = bless( \*Symbol::GEN0, 'Net::Telnet' );
See attached for diff.
Subject: | net-telnet-304-input-log-fix.txt |
--- /usr/share/perl5/Net/Telnet.pm 2013-09-16 19:50:35.000000000 +1000
+++ lib/Net/Telnet.pm 2015-07-08 16:38:54.485489290 +1000
@@ -250,17 +250,17 @@
}
if (defined $input_log) { # user wants to set input_log
- $self->input_log($input_log)
+ defined( $self->input_log($input_log) )
or return;
}
if (defined $option_log) { # user wants to set option_log
- $self->option_log($option_log)
+ defined( $self->option_log($option_log) )
or return;
}
if (defined $output_log) { # user wants to set output_log
- $self->output_log($output_log)
+ defined( $self->output_log($output_log) )
or return;
}