in reply to passing a value to a function
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);
|
---|