This isn't C, and you don't need the parentheses after cleararray. In fact, they're hurting you, since by using them, you've told Perl that cleararray takes no arguments. Remove them.
Also, note that you're taking the first argument to cleararray and throwing it away, and then referring to a global. It might be better (depending on your program design) to pass in $radiovar. If you want to call cleararray as a class method, you can do this:
sub cleararray
{
my $class = shift; # ignored
my $radiovar = shift;
...
}
# then call as:
PATTERNS->cleararray($someRadioVar);
or if you are always calling it from within the same package it's defined in, perhaps:
sub cleararray
{
my $radiovar = shift;
...
}
# then call as:
cleararray($someRadioVar);