Mo::required(3)

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

✨ NAME ✨

Mo::required β€” okay bestie, this is the little Mo plugin that adds the required feature to Mo's has πŸ’… it's in section 3 of the User Contributed Perl Documentation, so it's a Perl module manpage, and it is so tiny and so powerful. 🫢


🌸 SYNOPSIS 🌸

Like, here's literally all the setup you need:

use Mo qw'required';
has name => ( required => 1 );

That's it. That's the whole vibe. πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

So what does it do?? It adds the required parameter to has. πŸ‘‘

And when required is set to a positive value, the constructor will die if the attribute is not set. πŸ’€ No cap, it just refuses. Attribute missing? Boom, constructor's gone, it's giving dramatic exit and honestly? deserved.

⚠️ Heads up bestie: positive value on required means the constructor dies when the attribute isn't set. That's not a warning, that's not a gentle nudge, that's a full-on death. πŸͺ¦

That's the whole page, iykyk. 🌈 This gorgeous lil slice of documentation is from perl v5.42.0, dated 2025-07-25 β€” shoutout to whoever wrote it, iconic behaviour fr fr. πŸ’– ✨ πŸŽ€ πŸ¦‹ 🌸 πŸ’… 🫢

πŸ“¦ where this page comes from