in reply to Re: Trying to create IO::Socket::SecureSocks
in thread Trying to create IO::Socket::SecureSocks

I see. Basically, what you want is "use class IO::Socket::Socks, but not quite." - though one.

You could potentially get lucky with Class::Prototyped, see Randal's article in Linux-Magazine.

update: code snippet retracted

... or how about this:

package IO::Socket::SecureSocks; use strict; use warnings; use IO::Socket::Socks; use IO::Socket::SSL; sub new { my $self = IO::Socket::SSL->new(@_); bless $self, "IO::Socket::Socks"; } 1;

This creates a IO::Socket::SSL object, and then reblesses it into the IO::Socket::Socks class. It assumes that you know that IO::Socket::Socks inherits the constructor from its base class, so it's still somewhat kludgy :).

--saintmike

Replies are listed 'Best First'.
Re: Re: Re: Trying to create IO::Socket::SecureSocks
by signal9 (Pilgrim) on Mar 02, 2004 at 22:35 UTC

    Why not just "use base( 'IO::Socket::Socks' );", then just add/override methods as you need?

    Update: Oops! Example used modules I was working on for work that day, rather than the modules in question. Fixed that.