<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="font-family: -webkit-monospace; font-size: 10px; ">Hello all<br><br>I'm having a few problems with some basic object oriented methods. My constructor and set method works fine, but I'm struggling to read the keys back from the object once it is created. My methods are attached below along with a screen dump of the created object. Any help would be greatly appreciated.<br><br><br> sub new<br> {<br> my $class=shift;<br> my $self = {};<br> $self->{_DATASET}=undef;<br> $self->{_RULE}=undef;<br> $self->{_PRIVILEGE}=undef;<br> $self->{_ACC_VIA_RULE}= {};<br> $self->{_ACC_VIA_PRIV}= [];<br> $self->{_CAN_UPDATE_RULE} =[];<br> bless ($self,$class);<br> return $self;<br> }<br><br> sub set_acc_via_rule<br> {<br> my $self = shift;<br> my $key = shift;<br> my @val = @_;<br> foreach my $val (@val)<br> {<br> unshift @{$self->{_ACC_VIA_RULE}{$key}},$val;<br> }<br> return;<br> }<br><br> sub get_back_keys<br> {<br> my $self = shift;<br> my ($key,$value);<br> while (my ($key,$value) = each ($self->{_ACC_VIA_RULE}))<br> {unshift @keys,$key;}<br> return @keys;<br> }<br><br>Type of arg 1 to each must be hash (not hash element) at acf2_dataset.pm line 122, near "})"<br><br>Regards<br><br>Gerd<br></span><div><font class="Apple-style-span" face="-webkit-monospace" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></div><div><font class="Apple-style-span" face="-webkit-monospace" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></div><div><font class="Apple-style-span" face="-webkit-monospace" size="2"><span class="Apple-style-span" style="font-size: 10px;"><img height="219" width="672" apple-width="yes" apple-height="yes" src="cid:75959F7A-74C1-439C-AE5C-CE2818A03AC4"></span></font></div></body></html>