Please forgive what I feel sure verges on a stupid question...but...
I *think* I have some understanding of what you are typing to do. Although it is right at the farthest edge of understanding... But why do you want to? There are well tested existing Test::Most and Test2::Suite and similar modules. What does this approach to testing achieve that these existing solutions don't?
I thought it was a deliberate part of the design of Perl that the functional code and the tests for it were kept distinct and separate.