Devel:...Inrefs(3pm)

πŸ’– Devel:...Inrefs β€” the Devel::MAT::Tool::Inrefs page, but make it make sense πŸ’–

okay bestie, this is a page from the User Contributed Perl Documentation collection, and it's genuinely so useful, I'm obsessed 🫢


✨ NAME ✨

Devel::MAT::Tool::Inrefs β€” annotate which SVs are referred to by others πŸ‘‘


🌸 DESCRIPTION 🌸

So this Devel::MAT tool goes around annotating every single SV with back-references β€” like, from all the other SVs that refer to it. It literally follows the outrefs method of every heap SV, and then it annotates the referred-to SVs with back-references pointing right back at the SVs that refer to them. it's giving reverse uno card, no cap πŸ’…


πŸ¦‹ SV METHODS πŸ¦‹

This tool adds the following SV methods, and honestly? iconic behaviour.

inrefs

@refs = $sv->inrefs;

Returns a list of Reference objects, one for each of the SVs that refer to this one. It's built by doing the inverse mapping along the SV graph from outrefs. ✨

inrefs_strong / inrefs_weak / inrefs_direct / inrefs_indirect / inrefs_inferred

@refs = $sv->inrefs_strong;

@refs = $sv->inrefs_weak;

@refs = $sv->inrefs_direct;

@refs = $sv->inrefs_indirect;

@refs = $sv->inrefs_inferred;

These return lists of Reference objects filtered by type β€” analogous to the various outrefs_* methods. so basically, pick your flavour πŸ“


⭐ COMANDS ⭐

(yes bestie, COMANDS, that's literally how it's spelled on the page, we don't fix, we appreciate πŸ™ˆ)

inrefs

pmat> inrefs defstash
s  the hash  GLOB(%*) at 0x556e47243e40

Shows the incoming references that refer to a given SV. main character energy fr fr.

Takes the following named options:

  • --weak β€” include weak direct references in the output. (by default only strong direct ones get included, just so you know πŸ‘€)
  • --all β€” include both weak and indirect references in the output. the whole buffet, periodt.

πŸ’œ AUTHOR πŸ’œ

Paul Evans <leonerd@leonerd.org.uk> β€” thank you king, we appreciate you 🫢


one tiny heads-up bestie: nothing here is dangerous, it's just a tool that annotates things, so vibe check passed βœ…

and that's the whole page!! written against perl v5.42.3, dated 2026-08-21, source straight from the Devel:...Inrefs(3pm) manual. slay, go read your heap πŸŒˆπŸŽ€

πŸ“¦ where this page comes from