in reply to Passing IO::Socket::INET

You're confusing subroutine invocation with method invocation. When you do
if (!authenticate($session)) { ...
you're passing a single parameter.
sub authenticate { my ($self, $session) = @_; ...
then puts this this single parameter into $self, which isn't what you expect.

To invoke authenticate() as a method, you would need to write

if (! $self->authenticate($session)) { ...
But this wouldn't work, since start() doesn't set up $self.

Replies are listed 'Best First'.
Re: Re: Passing IO::Socket::INET
by jk2addict (Chaplain) on Jan 27, 2003 at 19:19 UTC

    Bing. That was the problem. I know better, yet the stupidity persisted. (Step away from the keyboard, there's nothing more to break here.)