Devel:...Method(3pm)

πŸ“¦
version 0.021 Β· 5 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ 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 (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