Mo::importer(3)

πŸ“¦
version 0.40 Β· 2 versions
, in fedora 43

✨ Mo::importer πŸ’…

okay bestie, so you know how this page is Mo::importer(3)? yeah. section 3, Perl land. it's giving "write your own import() extension" and honestly? iconic. πŸŽ€


🌸 Name

Mo::importer β€” write your own import() extension 🫢


✨ Synopsis

package MyMo;

sub importer {
    my ($caller, @args) = @_;
    ...
}

use Mo qw[importer other features];

πŸ’– Description

so like. sometimes you're out here living your life and you need to add your own logic during Mo::import time. not a want, a need. and this feature? it lets you do exactly that, no cap. you just define your own importer subroutine and Mo will come find it. πŸ‘‘

when it calls you, it passes you the original caller pkg and the args that got passed in. that's the whole vibe. ($caller, @args) and you take it from there. πŸ’…


πŸ¦‹ Note

real talk: you need to define that importer sub before you use Mo .... for (hopefully) obvious reasons. :\ 😭

like, define it first. then use Mo. the order is the whole point, bestie, don't do it backwards and then act surprised. πŸ™ˆ


and that's the tea, fr fr. this page was served up by perl v5.42.0 on 2025-07-25 β€” slay, date-stamped, immortalized. πŸ’œβœ¨πŸŒΈ

πŸ“¦ where this page comes from