in reply to inheritance problem

Within your sub sysreadline the call to sysread is just a a plain subroutine call and not a method call. What happens if you make it a method call instead?

Replies are listed 'Best First'.
Re^2: inheritance problem
by philippe44 (Initiate) on Oct 07, 2015 at 01:59 UTC
    understood but so if the plain sysread is called, then what confused me a lot is that another app required a derivative of this code where SSL must be used to 'top' is inheriting from both 'remote' and 'IO::Socket::SSL' (I had to do that because I cannot modify the 'remote' class, I can only touch the descendant 'top') class
    base qw (IO::Socket::SSL remote);
    With that, method calls will always try to be resolved in IO::Socket::SSL first, before going to IO::Socket::INET - this might be ugly and there might be a clean way to do that, I just don't know
    But although this works, now what happens is that the plain sysread (made in sysreadline) uses the overloaded sysread method in 'top'???
      bummer ... got it now, it was a side-effect of adding a SSL socket. The calls to top::sysread were not made by 'request' but were made by the SSL negotiation !