Inlining Mo

This section explains how to inline/embed Mo in your code.

The module Mo.pm has 2 lines. The first line is:

package Mo;$VERSION=#.##;

The second line is the compressed Mo code.

If you want to inline Mo, it is best that you do it under your own package name. That way, if you use other modules that use Mo, you won't clobber their version of Mo or vice versa. Do something like this:

BEGIN {
    package YourClass::Mo;
    <2nd line of Mo.pm goes here>
    $INC{'YourClass/Mo.pm'} = __FILE__;
}

package YourClass;
use YourClass::Mo;

The Mo code will self-adjust itself to your package. You need to tell %INC about this new class so that you can use YourClass::Mo, otherwise perl will try to load it from disk and likely fail.

External Mo Reuse

Another option is to copy Mo into a module called YourClass/Mo.pm. That would look like this:

package YourClass::Mo;
<2nd line of Mo.pm goes here>
1;