T M
class PseudoStash
Error ReportCollection examples

Stash type for pseudo-packages

class PseudoStash is Map { }

PseudoStash is the stash type (hanging off .WHO) that backs various pseudo-packages. So, when you do MY:: or CALLER::, that gives back a PseudoStash. In most cases, Package:: gives back a Stash. Neither of these are objects the user is expected to create by themselves, but in case you have one, you can just use it like a hash.

my $a = 42;
my $b = q/$a/;
say MY::{$b};
# OUTPUT: «42␤» 

This shows how you can use a PseudoStash to look up variables, by name, at runtime.