in reply to OO Simple THing
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: OO Simple THing
by Fletch (Bishop) on Mar 29, 2004 at 02:50 UTC | |
|
Re: Re: OO Simple THing
by cormac (Acolyte) on Mar 29, 2004 at 02:34 UTC |