Mo::coerce(3)

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

πŸ¦‹ NAME πŸ¦‹

okay so Mo::coerce is literally the moment β€” it adds the coerce feature to Mo's has. that's the whole vibe, bestie. no cap. πŸ’…


✨ SYNOPSIS ✨

like, here's how you'd actually use it:

           use Mo qw'coerce';
           has name => ( coerce => sub { uc $_[0] } );

πŸ’– DESCRIPTION πŸ’–

so Mo::coerce adds the coerce parameter to has. and what does that parameter want? a code reference, bestie β€” like a sub. that code ref is used to transform the value that's about to be set. it's giving "glow-up before it hits the attribute". periodt. 🫢


πŸ’… cute lil sign-off πŸ’…

this iconic page is from perl v5.42.0, dated 2025-07-25, and it's the manual for Mo::coerce(3) β€” brought to you by the User Contributed Perl Documentation crew. stay slaying ✨

πŸ“¦ where this page comes from