Mo::coerce(3)
π¦ 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
- fedora 43: perl-Mo 0.40-28.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms