class PseudoStash

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.

The Camelia image is copyright 2009 by Larry Wall. "Raku" is a trademark of the Yet Another Society. All rights reserved.

Built with Podlite β€” the markup and publishing tools behind this site.