perl object Oriented Programming Question
I've created a perl object where I would like to create a 2nd object inside the "new" constructer. By doing this, I hope that the 2nd object can persist throughout all subsequent method calls. However, retreiving the object through the self instance isn't happening. Can I even do this? Here's my example code:
sub new {
my($pkg) = shift;
my($self) = {};
bless $self, $pkg;
my $java = new Java();
$self->{'java'} = $java;
return $self;
}
|