Actually, because methods are looked up at runtime you can drop the eval altogether and just do $class->$invoke();. Of course this assumes you've already vetted the value of $invoke to ensure that it's 1) defined in the module; and 2) not a private method or otherwise unfit for use. To be on the safe side, probably using the BLOCK form of eval is the best way to go:
eval { $val = $class->$invoke() };
warn $@ if $@; # or something
BTW, it may work better to use an environment variable to indicate debugging mode rather than a harcoded string scattered about.
"The dead do not recognize context" -- Kai,
Lexx