gpmartinson has asked for the wisdom of the Perl Monks concerning the following question:
Now when I write a simple testfilesub new { my ($class)=@_; bless { _roundnum =>$_[1], _room =>$_[2], _judge =>$_[3], _type =>$_[4], _code =>$_[5], _contestants =>$_[6] },$class; } sub roundnum{ my ($self, $roundnum)=@_; $self->{_roundnum}=$roundnum if defined $roundnum; return $self->{_roundnum}; } ################################
use round; my $test=new round{roundnum=>1} $testval=$test->roundnum; print $testval
I get a hash back... Can someone explain this to me. I feel like this oo thing is more slippery every time I try it.
20040328 Edit by Corion: Added formatting
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: OO Simple THing
by tinita (Parson) on Mar 28, 2004 at 19:48 UTC | |
|
Re: OO Simple THing
by graff (Chancellor) on Mar 28, 2004 at 19:53 UTC | |
|
Re: OO Simple THing
by Aragorn (Curate) on Mar 28, 2004 at 19:49 UTC | |
|
Re: OO Simple THing
by cormac (Acolyte) on Mar 28, 2004 at 20:39 UTC | |
|
Re: OO Simple THing
by dragonchild (Archbishop) on Mar 29, 2004 at 00:17 UTC | |
by Fletch (Bishop) on Mar 29, 2004 at 02:50 UTC | |
by cormac (Acolyte) on Mar 29, 2004 at 02:34 UTC | |
|
Re: OO Simple THing
by gpmartinson (Novice) on Mar 29, 2004 at 00:23 UTC |