sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = {FILENAME => undef, NAME => undef, VAL => undef, ATYPE => undef, VOL => undef, MASS => undef, DESC => undef, RACE => undef, stats_change => [], @_}; # <-- Note this line here. # It takes the values passed to new and will override the "defaults" set above. bless($self); return $self; }