in reply to Function refs, and trying to keep strict

foreach my $test (@tests){ if($mask & $byte{$test}){ if (my $method = $t->can($test)) { $mask = $mask ^ $byte{$test} unless $t->$method(); } # else error handling! #if the test returned false we unset the bit } }
Whenever you have the name of a method and need a coderef, use can(), it will return undef if the object has no such method or a CODE ref otherwise.