diff options
Diffstat (limited to 'lib/Package')
-rw-r--r-- | lib/Package/Stash/PP.pm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Package/Stash/PP.pm b/lib/Package/Stash/PP.pm index 9004c5d..fdb8da9 100644 --- a/lib/Package/Stash/PP.pm +++ b/lib/Package/Stash/PP.pm @@ -26,6 +26,17 @@ This is a backend for L<Package::Stash> implemented in pure perl, for those with sub new { my $class = shift; my ($package) = @_; + + if (!defined($package) || (ref($package) && ref($package) ne 'HASH')) { + confess "Package::Stash->new must be passed the name of the " + . "package to access"; + } + elsif (ref($package) eq 'HASH') { + confess "The pure perl implementation of Package::Stash doesn't " + . "currently support anonymous stashes. You should install " + . "Package::Stash::XS"; + } + return bless { 'package' => $package, }, $class; |