Re: Inserting a new data structure in a bless reference

2012-01-15 Thread David Christensen
On 01/13/2012 07:25 PM, Parag Kalra wrote: my $obj = FooBar->new; $obj->{'new_key'} = 'some_value' Now I am not sure if that is the correct way of inserting a new data structure into an already bless reference 1. FooBar may or may not be implemented as a hashref. 2. It's not wise to muck wit

Re: Inserting a new data structure in a bless reference

2012-01-14 Thread Shawn H Corey
On 12-01-13 10:25 PM, Parag Kalra wrote: The simplest way I thought of expressing this question is through Pseudo-script so here it is: use strict; use warnings; use FooBar; my $obj = FooBar->new; Do something ... $obj->{'new_key'} = 'some_value' Now I am not sure if that is the

Re: Inserting a new data structure in a bless reference

2012-01-13 Thread Jeff Peng
于 2012-1-14 11:25, Parag Kalra 写道: use FooBar; my $obj = FooBar->new; Do something ... $obj->{'new_key'} = 'some_value' Now I am not sure if that is the correct way of inserting a new data structure into an already bless reference I don't think you should modify the blessed obj