in reply to Re^2: Perl OOP help for OOP newbie
in thread Perl OOP help for OOP newbie
package User; sub new { my ($class, $username) = @_; my $self =(username=> $username, accounts=>{} , # No accounts for a +new user server=> {Some server connection info} ); bless $self, $class; } sub open_account { my ($self, $account_id) = @_; return $self->accounts->{$account_id} = User::Account->new($self, $ac +count_id); } # accessor for accounts.. sub get_account{ my ($self,account_id) = @_; return $self->accounts->{account_id}; }
"XML is like violence: if it doesn't solve your problem, use more."
|
|---|