Unfortunately, it doesn't seem to work... :-(

My constructor:

sub new {
   my $that = shift;
   my $class = ref($that) || $that;
   my $self = {
      %myflds,
   };
   bless $self, $class;
   return $self;
}

Please help,
Ela

> -----Ursprüngliche Nachricht-----
> Von: Jos Boumans [mailto:[EMAIL PROTECTED]]
> Gesendet: Montag, 11. Juni 2001 12:04
> An: Ela Jarecka
> Cc: Beginners list (E-Mail)
> Betreff: Re: Getting to the contents of a class..
> 
> 
> What myflds probably is (if used a 'normal' contructor 
> returning a hashref), is
> a hashref
> 
> if you want to acces it, you'll need something like:
> 
> foreach my $item ( keys %{$reqrec->myflds} ) { ..}
> 
> now, if that is not working, you might want to concider 
> posting the constructor
> of your module to the list, it would make it easier for us to 
> indicate the
> problem
> 
> hth,
> 
> Jos Boumans
> 
> Ela Jarecka wrote:
> 
> >
> > foreach my $item ( keys $reqrec->myflds ) {          #line 26
> >  ...
> > }
> >
> > I get an error:
> > 'Can't locate object method "myflds" via package "DataReq" 
> at makeReq line
> > 26'
> >
> > How should I indicate that 'myflds' is a hash? I've tried 
> putting an '%' in
> > front of 'myflds' but it returned
> > an error as well.
> 

Reply via email to