package Round; sub new { my $class = shift; my %args = @_; my $self = {}; $self->{_$_} = $args{$_} for qw( roundnum room judge type code contestants ); bless $self, $class; } sub roundnum { my $self = shift; $self->{_roundnum} = shift if @_; $self->{_roundnum}; } ------------- use Round; my $test = Round->new( roundnum => 1 ); my $testval = $test->roundnum; print "$testval\n";
That should give you the answer you're looking for.
------
We are the carpenters and bricklayers of the Information Age.
Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose
In reply to Re: OO Simple THing
by dragonchild
in thread OO Simple THing
by gpmartinson
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |