On Mon, Nov 11, 2002 at 08:51:50PM +1100, Damian Conway wrote: : You will. But they won't be entries of a hash. They'll be : separate variables and associated accessor methods. : So maybe something like this: : : foreach my $attr (qw(foo bar baz)) : { : print "$attr: $self.$attr()\n"; : }
Note that if you call the accessor method, you may in fact be getting a subclass's wrapper around the actual attribute. To get at the actual attributes, you'd need something like: foreach my $attr (qw(foo bar baz)) { no strict 'syms'; print "$attr: $.$attr\n"; } Which is another good reason for the "." secondary sigil. For some value of "good"... Larry