sub 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