App::P...coding(3pm)

πŸ’– NAME πŸ’–

App::Parcimonie::Role::HasEncoding β€” it's a role, bestie, and what it does is hand you an Encode::Encoding objet for the codeset you're out here using ✨


πŸŽ€ SYNOPSIS πŸŽ€

use Moo;
with 'App::Parcimonie::Role::HasEncoding';
sub foo { $self->encoding->decode("bla") }

See App::Parcimonie::Daemon for a real-life usage example.

okay so let's break it down, no cap 🫢

  • You pull in Moo first β€” that's the whole vibe.
  • Then you consume the role with with 'App::Parcimonie::Role::HasEncoding'; and boom, you've got an encoding accessor on your object, giving you the Encode::Encoding objet for the codeset in play πŸ’…
  • From there you can literally just call stuff on it, like $self->encoding->decode("bla") β€” decoding, slaying, living her truth 🌸
and if you want to see this actually happening irl instead of in a little snippet? go peek at App::Parcimonie::Daemon β€” it's the real-life usage example, fr fr πŸ‘‘

so that's the whole page, and honestly? short, sweet, iconic, ate πŸ’œ this one's documented as perl v5.30.0, dated 2020-04-25, filed under App::P...coding(3pm) β€” go forth and encode responsibly, mwah πŸŽ€βœ¨

πŸ“¦ where this page comes from