package SillyVec3D; use strict; use warnings; use Logndebug; sub new { my $class = shift; my $self = bless { @_ }, $class; for my $attr ( keys %{ $self } ) { no strict 'refs'; eval qq[ *{ $attr } = sub { LOG( "$attr called with [\@_]" ); my \$self = shift; DEBUG( "$attr set to: ", \$self->{ $attr } = shift ) if \@_; \$self->{ $attr }; } ]; } return $self; } 1;