> > > > foreach my $item ( keys $reqrec->myflds ) {          #line 26
> > > >  ...
> > > > }
> 
> If, out of the constructor you showed us above, you're 
> expecting the myflds
> method to automatically be created, and return your hash, 
> it's not going to
> happen.  You have to define a myflds method, probably 
> something along the
> lines of:
> 
>     sub myflds {
>         my $self = shift;
>         return $self;
>     }
> 
> From this point on, you can now refer to %{ $reqrec->myflds }.
Thanks for your advice.. Just to clarify - I was not expecting any miracles,
it was simply a misunderstanding at my part.
I thought that if you can call a method in that way:
$myvar->myfunction(...), then you can access a variable of a class in a 
similar way, say: $myvar->%myhash...
In my code, I finally wrote:

foreach my $item ( keys %$reqrec ) {
...
}

Ela

Reply via email to