In this package, it wont get any values but stats_change...
package item; use strict; sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = {}; $self->{FILLABLE} = undef; $self->{NAME} = undef; $self->{VAL} = undef; $self->{ATYPE} = undef; $self->{VOL} = undef; $self->{MASS} = undef; $self->{DESC} = undef; $self->{RACE} = undef; $self->{stats_change} = []; bless($self); return $self; } sub name { my $self = shift; if (@_) { $self->{NAME} = shift } return $self->{NAME}; } sub val { my $self = shift; if (@_) { $self->{VAL} = shift } return $self->{VAL}; } sub atype { my $self = shift; if (@_) { $self->{ATYPE} = shift } return $self->{ATYPE}; } sub vol { my $self = shift; if (@_) { $self->{VOL} = shift } return $self->{VOL}; } sub mass { my $self = shift; if (@_) { $self->{MASS} = shift } return $self->{MASS}; } sub desc { my $self = shift; if (@_) { $self->{DESC} = shift } return $self->{DESC}; } sub race { my $self = shift; if (@_) { $self->{RACE} = shift } return $self->{RACE}; } sub immortal { my $self = shift; if (@_) { $self->{IMMORTAL} = shift } return $self->{IMMORTAL}; } sub fillable { my $self = shift; if (@_) { $self->{FILLABLE} = shift } return $self->{FILLABLE}; } sub stats_change { my $self = shift; if (@_) { @{ $self->{stats_change} } = @_ } return @{ $self->{stats_change} }; } 1;
When i dump the values of an example of this, i get...
$VAR1 = bless( { 'DESC' => undef, 'stats_change' => [ 19, 3 ], 'ATYPE' => undef, 'VOL' => undef, 'NAME' => undef, 'VAL' => undef, 'MASS' => undef, 'FILLABLE' => undef, 'RACE' => undef }, 'item' );
Why wont it take the values for the rest of them?

In reply to OO package problems... by Ahbeyra

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.