diff options
author | Jesse Luehrs <doy@tozt.net> | 2010-08-27 11:16:28 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2010-08-27 11:23:24 -0500 |
commit | 34b3fdd2f60e9abce14a19de07a2574db5ec4017 (patch) | |
tree | 480be68aa16caed47e1cc44458afbbd0157e4b5c /lib/Package/Stash.pm | |
parent | f8e7797c12671e47664c32b6c00b5ee4c8993504 (diff) | |
download | package-stash-34b3fdd2f60e9abce14a19de07a2574db5ec4017.tar.gz package-stash-34b3fdd2f60e9abce14a19de07a2574db5ec4017.zip |
more complete handling of vivication
Diffstat (limited to 'lib/Package/Stash.pm')
-rw-r--r-- | lib/Package/Stash.pm | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/Package/Stash.pm b/lib/Package/Stash.pm index b990f55..77236d0 100644 --- a/lib/Package/Stash.pm +++ b/lib/Package/Stash.pm @@ -5,6 +5,7 @@ use warnings; use Carp qw(confess); use Scalar::Util qw(reftype); +use Symbol; =head1 SYNOPSIS @@ -241,9 +242,20 @@ sub get_package_symbol { elsif ($type eq 'HASH') { $self->add_package_symbol($variable, {}); } + elsif ($type eq 'SCALAR') { + $self->add_package_symbol($variable); + } + elsif ($type eq 'IO') { + $self->add_package_symbol($variable, Symbol::geniosym); + } + elsif ($type eq 'CODE') { + # ignoring this case for now, since i don't know what would + # be useful to do here (and subs in the stash autovivify in weird + # ways too) + #$self->add_package_symbol($variable, sub {}); + } else { - # FIXME - $self->add_package_symbol($variable) + confess "Unknown type $type in vivication"; } } |