On Mon, Jul 23, 2001 at 07:40:03PM +0200, Abigail wrote: > my (%Family, %Given, %DOB, %EmpNum, %Manager); > > sub Employee::New ($$$) { > my $class = shift; > my $lastname = shift; > my $firstname = shift; > > my $self = bless [] => $class; > > $Family {$self} = $lastname; > $Given {$self} = $firstname; > $DOB {$self} = undef; > $EmpNum {$self} = undef; > $Manager {$self} = undef; > > $self; > } Okay, now THAT is clever! Unfortunately, it makes automated accessor generation a little tricky... in fact, probably impossible. You'd have to define your automation code in the same scope as your class, so you can't simply subclass off an automator (like Class::Accessor). And that sucks, since you now *must* write accessors. Carpal Tunnel. But then I guess that's what you pay for total privacy. :( -- Michael G. Schwern <schwern@pobox.com> http://www.pobox.com/~schwern/ Perl6 Quality Assurance <perl-qa@perl.org> Kwalitee Is Job One Jesus hates me. http://www.unamerican.com/Thread Previous | Thread Next