Well cleararray() tell it to expect no arguements. You would need to do cleararray($) You would also need to pick it up by changing my $class = shift; to my ($self, $radiovar) = @_;
I believe I have heard that the prototyping in Perl is not really worth the effort; Especially when using OO because they are not checked in OO code.