I wanted to export a simple function from a base class that I use all over my sub classes without having to use $self->myfunc() all the time, just a simple func() call.
I tried doing this with the example from Moose::Exporter
but I didnt understand what
as_is => [ 'sugar3', \&Some::Random::thing ],
was doing, as the example seems incomplete. sugar3 isnt defined anywhere, so I dunno where or how to use it. Can I call sugar3() in the subclass now? Is sugar3() some secret Moose thing?
and then the was this thing... literally
thing;
that was exported, but I have no idea what thing is doing since there is no example of it. Is this a function call?
Anyway, more to the point how do you export functions like you would normally do with Exporter, but with Moose Exporter instead, and what happens if my baseclass has 3 levels of inheritance after it, will all the sub sub classes have access to this exported function?