Mason::Tidy(3)

πŸ“¦
version 2.57 Β· 2 versions
, in fedora 43

πŸ’– Mason::Tidy β€” the manual, but make it a group chat πŸ’–

okay so bestie, this is Mason::Tidy(3), and yeah it's from the User Contributed Perl Documentation corner of the universe, but don't let that scare you. it's literally the engine that powers masontidy, and it's lowkey iconic. sit down, grab a strawberry πŸ“, and let's get into it.


✨ NAME ✨

Mason::Tidy β€” it's the engine for masontidy. that's it, that's the whole vibe. πŸŽ€


🌸 VERSION 🌸

version 2.57, periodt. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

here's how you'd actually use it in your own little program, no cap:

use Mason::Tidy;

my $mc = Mason::Tidy->new(mason_version => 2);
my $dest = $mc->tidy($source);

look at that. two lines and you're the main character. πŸ‘‘


🌈 DESCRIPTION 🌈

so, real talk: this right here is the engine that masontidy runs on. bestie, go read that one first if you want the big-picture tea β€” this is just the engine room. πŸ”§

the fun part? you don't have to run the masontidy command at all. you can call this API straight from your own program instead of executing "masontidy". it's giving "I'll do it myself" energy and honestly? respect. πŸ’–


πŸŽ€ CONSTRUCTOR PARAMETERS πŸŽ€

these are the knobs you can twist when you build your Mason::Tidy object. they're all the same as the equivalent "masontidy" command-line options β€” you just swap the dashes for underscores (so like, the --indent-per-block option becomes indent_perl_block here). cute, right? 🧚

  • indent_block β€” same deal as the masontidy option of the same name, dashes-to-underscores and all.
  • indent_perl_block β€” same deal as the masontidy option of the same name, dashes-to-underscores and all.
  • mason_version β€” required, bestie! you literally cannot skip this one. πŸ™ˆ
  • perltidy_argv β€” same deal as the masontidy option of the same name, dashes-to-underscores and all.
  • perltidy_block_argv β€” same deal as the masontidy option of the same name, dashes-to-underscores and all.
  • perltidy_line_argv β€” same deal as the masontidy option of the same name, dashes-to-underscores and all.
  • perltidy_tag_argv β€” same deal as the masontidy option of the same name, dashes-to-underscores and all.

πŸ’… METHODS πŸ’…

tidy ($source)

this is the one. you hand it component source $source, it tidies it up, and it hands you back the tidied result. glow-up complete. ✨

⚠️ but listen β€” if the source can't be tidied (say, invalid syntax, oop), it will throw a fatal error. no gentle vibes, just a hard stop. don't say I didn't warn you. πŸ’€

🫢 AUTHOR 🫢

Jonathan Swartz <swartz@pobox.com> β€” the legend who made this happen. thank you for your service, king. πŸ‘‘


this software is copyright (c) 2011 by Jonathan Swartz.

it's free software, bestie β€” you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. free as in freedom, free as in slay. 🌈


aaaand that's the whole page! πŸŽ‰ this was Mason::Tidy, perl v5.42.0, dated 2025-07-25. mwah, go tidy something gorgeous. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from