Parse:...:Param(3pm)
πΈ Parse::Method::Signatures::Param π
okay bestie, so this is a page from the User Contributed Perl Documentation and the manual name is Parse:...:Param(3pm) β say it with me, it's a whole vibe. π
β¨ NAME β¨
Parse::Method::Signatures::Param β literally just a parsed parameter that came out of a signature. that's it, that's the whole thing π¦
π ATTRIBUTES π
heads up: every single attribute on this class is read-only. no take-backs, no edits, no touching. look with your eyes only, bestie. π
requiredβ is this parameter required (true) or optional (false)? that's the whole question. πsigilβ the effective sigil of this parameter. and it's one of'$','@'or'%', periodt. πtype_constraintsβ π«Ά- Type:
Parse::Method::Signatures::TypeConstraint - Predicate:
has_type_constraints - this is the representation of the type constraint for this parameter. but lowkey, most of the time you're just gonna call
meta_type_constraintand not come anywhere near this attribute directly. iykyk. β¨
- Type:
default_valueβ π- Type:
Str - Predicate:
has_default_value - a string that should be
eval'd or injected to get the default value for this parameter. for example:
- Type:
$name = 'bar'
would give a default_value of "'bar'". yeah, the quotes come along for the ride, that's just how it is. π
constraintsβ π- Type:
ArrayRef[Str] - Predicate:
has_constraints - these are the
"where"constraints for this type. each member of the array is the string (including the enclosing braces) of thewhereconstraint block. so brace yourself, literally. π§
- Type:
param_traitsβ π- Type:
ArrayRef[ Tupple[Str,Str] ] - Predicate:
has_traits - the traits that this parameter is declared to have. for instance:
- Type:
$foo does coerce
would have a trait of:
['does', 'coerce']
cute, right? πΈ
π οΈ METHODS π οΈ
to_stringβ the name says it all bestie, it turns the thing into a string. β¨meta_type_constraintβ get theMoose::Meta::TypeConstraintfor this parameter. but FIRST, check that the type actually has a type constraint, because you don't wanna be that girl:
$tc = $param->meta_type_constraint if $param->has_type_constraints;
fr fr, don't skip the check. use has_type_constraints first or you're just asking for chaos. π
π SEE ALSO π
Parse::Method::Signatures. go read that one next, it's giving main character energy. π₯
π AUTHORS π
- Ash Berlin
<ash@cpan.org>. - Florian Ragwitz
<rafl@debian.org>.
absolute icons, we stan. π«Ά
π LICENSE π
Licensed under the same terms as Perl itself. slay. β
and that's the whole page, bestie! this was perl v5.34.0, dated 2022-06-16, brought to you by the Parse:...:Param(3pm) manual. mwah, go forth and parse responsibly πβ¨π
π¦ where this page comes from
- debian bookworm: libparse-method-signatures-perl 1.003019-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libparse-method-signatures-perl 1.003019-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libparse-method-signatures-perl 1.003019-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libparse-method-signatures-perl 1.003019-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libparse-method-signatures-perl 1.003019-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms