Use compile-time overloading.
Eg.
use classA; use classH; sub what_does_it_return { return rand(1) > 0.5 ? bless( [], 'classA' ) : bless( {}, 'classH' ); } my $o = what_does_it_return( ... ); $o->method( ... );
Viola. No introspection needed.
In reply to Re^2: Runtime introspection: What good is it?
by BrowserUk
in thread Runtime introspection: What good is it?
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |