%attr_populator = { name => \_get_core_data, bday => \_get_core_data, sizes => \_get_clothing_sizes_data, grades => \_get_grade_data, complex => \_get_really_expensive_data, }; sub AUTOLOAD { my $self=shift; my $attr=$AUTOLOAD; unless (exists $attr_populator{$attr}) die "Hey, that attribute does not exist!\n"; &{$att_populator{$attr}}($self) unless (exists $self->{$attr}) return $self->{$attr}; }