```{index} single: add_symbol (Package::Stash::XS) ``` ```{index} single: Package::Stash::XS::add_symbol ``` # add_symbol Install `$initial` in a slot: a reference installs its referent, a plain value a copy of it, nothing an empty value. Under the debugger (`$^P & 0x10`) a sub also gets its `%DB::sub` entry, from `filename`, `first_line_num` and `last_line_num` options. ## Synopsis ```perl $stash->add_symbol('$x', \1); $stash->add_symbol('@ISA', ['Base']); $stash->add_symbol('&f', sub { 42 }, filename => 'gen.pl', first_line_num => 1); ``` ## Edge cases - A value of the wrong kind dies "VALUE is not of type TYPE". - `&name` with no value dies "Don't know how to vivify CODE variables". - A name containing `::` dies "Variable names may not contain ::".