Subject: | incomplete support for logging to blessed refs which are not GLOBs |
Net::Telnet offers logging to filehandles or filenames using the Input_log option.
When this option is specified, the filehandle is processed by _fname_to_handle() (Telnet.pm line
2220) before being saved for later use.
When a logging event occurs, _log_print() (Telnet.pm line 2448) is called, and this subroutine
supports calling the print() method of a blessed ref which is not a GLOB.
In order for this to work as hoped when supplying an object to new(Input_log=> ), the behavior
of _fname_to_handle needs to be changed at line 2239:
select((select($fh), $|=1)[$[]); # don't buffer writes
The select call fails on an object which is not a GLOB.
Could a conditional statement similar to the one in _log_print() be placed into
_fname_to_handle(), so that the select call is only made if the filehandle is a GLOB ?
The altered code in _fname_to_handle would look like this:
if (ref($fh) and ref($fh) eq "GLOB") { # fh is a GLOB
select((select($fh), $|=1)[$[]);
}
Cheers -