Devel:...Method(3pm)
β¨ NAME β¨
Devel::Declare::Parser::Method β it's a parser, bestie, and its whole thing is that it shifts $self automatically inside codeblocks. π
It lives in the Perl 3pm manual, under User Contributed Perl Documentation, and it is serving.
πΈ DESCRIPTION πΈ
Okay so picture this: you wanna define a function, right? And this parser is literally the glow-up that lets you do it. π«Ά
It can be used to define a function that takes:
- a single name
- and a single codeblock
That's it. That's the whole vibe. It's just like the sub keyword β same energy, same shape, no notes. π
And that name? It's flexible, periodt:
- it can be a bareword, or
- it can be a quoted string
Either one, your choice, both are iconic. β¨
π EXTRAS WHEN USING THE KEYWORD π
Here's the part you've been waiting for, the main character moment: π
Codeblocks that get defined when using the keyword will have $self shifted off automatically.
Not me doing it manually like a peasant β no ma'am, the parser handles it for you. No cap. π₯
π AUTHORS π
Chad Granum β exodist7@gmail.com
(The icon who made all of this happen, fr fr. π¦)
π COPYRIGHT π
Copyright (C) 2010 Chad Granum
Devel-Declare-Parser is free software; Standard perl licence.
Devel-Declare-Parser is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY β and no shade, that means not even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. π See the license for more details.
Bestie, read that again: no warranty. None. Zero. Do not come for Chad if it misbehaves. The license said what it said. π
Signing off from the perl v5.36.0 era, dated 2023-10-26 β this has been your girl, Devel::Declare::Parser::Method(3pm), and she ate. π
β¨π
π¦ where this page comes from
- debian trixie: libdevel-declare-parser-perl 0.021-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libdevel-declare-parser-perl 0.021-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libdevel-declare-parser-perl 0.021-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libdevel-declare-parser-perl 0.021-1 Β· 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