in reply to Storing object references during creation of ->new object

Not this:

$server_objects{$options{'serial'}} = \$self;

This instead:

$server_objects{$options{'serial'}} = $self;
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Replies are listed 'Best First'.
Re^2: Storing object references during creation of ->new object
by perldarren (Novice) on Aug 05, 2012 at 15:34 UTC
    Thank you for the quick response. When I drop the \ I get:
    Can't call method "logout" on unblessed reference
      Here is the entire sub new:
      sub new { my $class = shift; my %options = @_; my $self = { _serial => $options{'serial'}, _log => $options{'log'}, _horcm => $options{'horcm'}, _does_get_cmd_status => $options{'does_get_cmd_status'}, }; bless $self, $class; $array_objects{$options{'serial'}} = $self; return $self; }

        Hold on ! tobyink, you're right - my issue is solved.

        Many thanks!