my $_print; *Foo::_print = sub { $_print = shift }; is($_print, $expected, "Foo::_print output the correct data");