$val="FOO"; $method="${val}::mySub"; if (exists &$method) {...}