Perl::...wigils(3pm)

πŸ’… Perl::...wigils(3pm) β€” aka Perl::Tidy::Sweetened::Variable::Twigils

okay bestie, you found the manual for Perl::Tidy::Sweetened::Variable::Twigils, and honestly? it's giving niche-but-iconic. this is a Perl::Tidy::Sweetened filter plugin that handles twigils, and yes we're gonna walk through it together, no cap. πŸ¦‹


✨ NAME ✨

Perl::Tidy::Sweetened::Variable::Twigils</p> β€” a Perl::Tidy::Sweetened filter plugin that handles twigls. that's literally the whole job. she does one thing and she eats. πŸ‘‘


🌸 VERSION 🌸

this one's rockin' version 1.20. periodt. πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

here's the vibe, copy it exactly:

our $plugins = Perl::Tidy::Sweetened::Pluggable->new();

$plugins->add_filter(
    Perl::Tidy::Sweetened::Variable::Twigils->new(
        twigil => '$!',
        marker => 'TWG_BANG',
    ) );

so you build your pluggable thing, you add_filter, you hand it a new Perl::Tidy::Sweetened::Variable::Twigils, and you tell it your twigil and your marker. done. slay. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so real talk: this is a Perl::Tidy::Sweetened filter, and what it does is enable the use of twigils as defined by the Twigils module. that's the whole plot. 🫢

New accepts:

  • twigil β€” like twigil => '$!'

declares a new twigil. in this specific case, it's meant to be used as "$!variable". cute, right?

  • marker β€” like marker => 'TWG_BANG'

provides a text marker β€” a lil flag 🚩 β€” to mark the new keywords during "prefilter".

so here's the ✨magic✨: your source code gets filtered prior to formatting by Perl::Tidy, such that this:

$!class_attribute

gets turned into this:

$__TWG_BANK_1

...and then, in the "postfilter", it gets turned back into the original twigiled variable. it's giving transform-and-restore, main character energy, iykyk. πŸ’«

lowkey obsessed with a filter that goes out and comes back like nothing happened. iconic behavior fr fr.

πŸ‘‘ AUTHOR πŸ‘‘

Mark Grimes <mgrimes@cpan.org> β€” the author. we stan. 🫢


🌈 SOURCE 🌈

the source repository lives at <https://github.com/mvgrimes/Perl-Tidy-Sweetened> β€” go peek, bestie, it's right there. ✨


πŸ’€ BUGS πŸ’€

please report any bugs or feature requests on the bugtracker website <https://github.com/mvgrimes/Perl-Tidy-Sweetened/issues>. no gatekeeping, we wanna know. πŸ™ˆ

and when you do submit a bug or a request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. that's the whole ask. a lil repro goes a long way, bestie. πŸ“


this software is copyright (c) 2023 by Mark Grimes <mgrimes@cpan.org>.

this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.


and that's the whole page!! 🌸 run it on perl v5.36.0, dated 2023-06-18, and go forth and twigil responsibly. mwah πŸ’…βœ¨

πŸ“¦ where this page comes from