in reply to Keeping data in an object
As this way you aren't re-assigning the object's reference (not that it affects the object itself) and you're also assigning the specified arguments passed in to $self so that the full_name method will behave as expected.sub first_name { my( $self, $args ) = ( shift, {@_} ); $self->{ first } = $args->{first}; return "First Name: $args->{first}\n"; }
_________
broquaint
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Keeping data in an object
by AzaBat (Acolyte) on Jun 29, 2003 at 01:57 UTC |