my $namespace = $self->namespace;
$namespace->{$name} ||= *{ Symbol::gensym() };
- *{ $namespace->{$name} } = ref $initial_value
- ? $initial_value : \$initial_value;
+
+ if (@_ > 2) {
+ *{ $namespace->{$name} } = ref $initial_value
+ ? $initial_value : \$initial_value;
+ }
}
sub remove_glob {
{
$foo_stash->add_symbol('%zork');
+ ok(!$foo_stash->has_symbol('$zork'),
+ "add_symbol with single argument doesn't vivify scalar slot");
my $syms = $foo_stash->get_all_symbols('HASH');