Hi, On 26.03.2015 16:55, Tom Browder wrote: > I need to test some private routines, so is there a way to do that?
The easiest way to do that is when the class with the private methods trusts the class that calls them. See for example http://doc.perl6.org/type/Metamodel::Trusting http://design.perl6.org/S12.html#Trusts https://github.com/perl6/roast/blob/master/S12-attributes/trusts.t But you should ask yourself if you really, really want this. And then you can also do something like: my $private_method = $obj.^private_method_table{$methodname}; $obj.$private_metnod(arguments here) but it is rather questionable use of the MOP. Cheers, Moritz