|Welcome to the Monastery|
|( #3333=superdoc: print w/replies, xml )||Need Help??|
This is a good review of Net::Telnet - I was interested in the bug-report and the problem which you found executing code under -w and so decided to do a little digging.
The problem which you encountered can be replicated on ActiveState Perl build 630 with the following line:
The problem lies in the _optimal_blksize method of the Telnet.pm module and is not related to ActiveState per se, but the manner by which this method is called from within the new initiation method. The code for the _optimal_blksize method is as follows:
This method is called without any parameters from the Net::Telnet new method and as such the variable $blksize will be undefined. This rightly generates the warning in the return $blksize if defined $blksize and ... line. This is expected behaviour under -w.
A straight-forward fix for this problem under -w execution can be applied by adding the line:
... which can be applied as the following diff patch ...
As an aside note, I tested and was unable to replicate this warning with similarly versioned copies of Net::Telnet on Perl 5.6.1 on a i686-Linux system. Perhaps there is something more to this or the way by which warnings are generated?
In reply to Re: Net::Telnet