Devel::MAT::Tool(3pm)

✨ NAME ✨

Devel::MAT::Tool β€” bestie, this is the plugin zone that lets you extend Devel::MAT πŸ’…


🌸 DESCRIPTION 🌸

okay so picture this: the Devel::MAT::Tool:: namespace is basically a lil' locker where you stash plugins that level up what Devel::MAT can do. Those tools are how you add extra analysis or extra display powers to the UI, no cap. And how does a tool talk to the UI? By calling methods in the Devel::MAT::UI package. that's the group chat πŸ’¬

A tool just drops itself into that namespace and brings along an object class. That's literally it. It does not need to inherit from anything specific β€” no weird family drama required. And the UI constructs tools lazily, only when the user actually asks for them. lowkey efficient, highkey iconic ✨


🫢 METHODS 🫢

These are the methods your tool class should show up with, bestie. Not all of them, but here's the whole menu:

πŸ’– FOR_UI

$display = CLASS->FOR_UI

If you want your tool sitting pretty on the UI's Tools menu, define this constant method and have it return a true value. that's the vibe check right there πŸ‘‘

πŸ’– CMD

$cname = CLASS->CMD

If your tool has a named command for the commandline, define this constant method and have it return the name. periodt.

πŸ’– AUTOLOAD_TOOL

$load = CLASS->AUTOLOAD_TOOL( $pmat )

If your tool should get auto-loaded for a given file, define this method to return a true value. When's that useful? say it with me: extra analysis πŸ”₯ Like when your tool peeks inside objects of specific classes, and those very classes are found in the file β€” boom, autoload, slay.

πŸ’– init_tool

$tool->init_tool()

Does whatever initialisation the tool needs β€” typically the bulk analysis stuff, run across the entire dumpfile heap. the heavy lifting, fr fr 😭

πŸ’– init_ui

$tool->init_ui( $ui )

Asks the tool to set up any UI elements it might need, by calling methods on the $ui you handed it. Heads up: $ui might be an object, or it might just be the package name Devel::MAT::UI directly. both are valid, don't panic πŸ¦‹


🌈 SVs 🌈

Tools may β€” and honestly, are encouraged to, where it makes sense β€” add methods to the Devel::MAT::SV package, so you can grab analysis results or do related lil' activities. πŸ’œ

Here's the tea: all SVs are implemented as blessed HASH references, and tools are allowed to use keys that begin with tool_... inside them. And please namespace your key and method names according to the tool name, because collisions are not the moment. πŸ™ˆ


πŸ‘‘ AUTHOR πŸ‘‘

Paul Evans <leonerd@leonerd.org.uk>


aaaand that's the whole page bestie!! this one shipped with perl v5.42.3, dated 2026-08-21, filed under User Contributed Perl Documentation. go forth and write iconic tools πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from