From: Dave Rolsky Date: Mon, 1 Sep 2008 15:05:01 +0000 (+0000) Subject: Explicitly die if get_all_package_symbols is called as a class method X-Git-Tag: 0.65~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=87b69f581c2f92a8e2f46dfa5ec0f35e2fbf17a1;p=gitmo%2FClass-MOP.git Explicitly die if get_all_package_symbols is called as a class method --- diff --git a/lib/Class/MOP/Package.pm b/lib/Class/MOP/Package.pm index 63299f8..a7ba14a 100644 --- a/lib/Class/MOP/Package.pm +++ b/lib/Class/MOP/Package.pm @@ -276,6 +276,10 @@ sub list_all_package_symbols { sub get_all_package_symbols { my ($self, $type_filter) = @_; + + die "Cannot call get_all_package_symbols as a class method" + unless ref $self; + my $namespace = $self->namespace; return %$namespace unless defined $type_filter;