summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2010-11-13 20:02:52 -0600
committerJesse Luehrs <doy@tozt.net>2010-11-13 20:04:15 -0600
commit15c104e23985b21347465208bbf0aef53db3d105 (patch)
tree45b23ab6d49520877bb6f74f60c680b8ec6497a2 /lib
parentdfabcbae2bf40ad18f242f632fc20de8800cf0cf (diff)
downloadpackage-stash-xs-15c104e23985b21347465208bbf0aef53db3d105.tar.gz
package-stash-xs-15c104e23985b21347465208bbf0aef53db3d105.zip
drop package_ from method names
Diffstat (limited to 'lib')
-rw-r--r--lib/Package/Stash.pm67
1 files changed, 56 insertions, 11 deletions
diff --git a/lib/Package/Stash.pm b/lib/Package/Stash.pm
index f385053..5811d7e 100644
--- a/lib/Package/Stash.pm
+++ b/lib/Package/Stash.pm
@@ -14,12 +14,57 @@ XSLoader::load(
? ${ $Package::Stash::{VERSION} } : (),
);
+use Package::DeprecationManager -deprecations => {
+ 'Package::Stash::add_package_symbol' => 0.14,
+ 'Package::Stash::remove_package_glob' => 0.14,
+ 'Package::Stash::has_package_symbol' => 0.14,
+ 'Package::Stash::get_package_symbol' => 0.14,
+ 'Package::Stash::get_or_add_package_symbol' => 0.14,
+ 'Package::Stash::remove_package_symbol' => 0.14,
+ 'Package::Stash::list_all_package_symbols' => 0.14,
+};
+
+sub add_package_symbol {
+ deprecated('add_package_symbol is deprecated, please use add_symbol');
+ shift->add_symbol(@_);
+}
+
+sub remove_package_glob {
+ deprecated('remove_package_glob is deprecated, please use remove_glob');
+ shift->remove_glob(@_);
+}
+
+sub has_package_symbol {
+ deprecated('has_package_symbol is deprecated, please use has_symbol');
+ shift->has_symbol(@_);
+}
+
+sub get_package_symbol {
+ deprecated('get_package_symbol is deprecated, please use get_symbol');
+ shift->get_symbol(@_);
+}
+
+sub get_or_add_package_symbol {
+ deprecated('get_or_add_package_symbol is deprecated, please use get_or_add_symbol');
+ shift->get_or_add_symbol(@_);
+}
+
+sub remove_package_symbol {
+ deprecated('remove_package_symbol is deprecated, please use remove_symbol');
+ shift->remove_symbol(@_);
+}
+
+sub list_all_package_symbols {
+ deprecated('list_all_package_symbols is deprecated, please use list_all_symbols');
+ shift->list_all_symbols(@_);
+}
+
=head1 SYNOPSIS
my $stash = Package::Stash->new('Foo');
- $stash->add_package_symbol('%foo', {bar => 1});
+ $stash->add_symbol('%foo', {bar => 1});
# $Foo::foo{bar} == 1
- $stash->has_package_symbol('$foo') # false
+ $stash->has_symbol('$foo') # false
my $namespace = $stash->namespace;
*{ $namespace->{foo} }{HASH} # {bar => 1}
@@ -45,13 +90,13 @@ Returns the name of the package that this object represents.
Returns the raw stash itself.
-=method add_package_symbol $variable $value %opts
+=method add_symbol $variable $value %opts
Adds a new package symbol, for the symbol given as C<$variable>, and optionally
gives it an initial value of C<$value>. C<$variable> should be the name of
variable including the sigil, so
- Package::Stash->new('Foo')->add_package_symbol('%foo')
+ Package::Stash->new('Foo')->add_symbol('%foo')
will create C<%Foo::foo>.
@@ -71,30 +116,30 @@ determine where the source code for a subroutine can be found. See
L<http://perldoc.perl.org/perldebguts.html#Debugger-Internals> for more
information about C<%DB::sub>.
-=method remove_package_glob $name
+=method remove_glob $name
Removes all package variables with the given name, regardless of sigil.
-=method has_package_symbol $variable
+=method has_symbol $variable
Returns whether or not the given package variable (including sigil) exists.
-=method get_package_symbol $variable
+=method get_symbol $variable
Returns the value of the given package variable (including sigil).
-=method get_or_add_package_symbol $variable
+=method get_or_add_symbol $variable
-Like C<get_package_symbol>, except that it will return an empty hashref or
+Like C<get_symbol>, except that it will return an empty hashref or
arrayref if the variable doesn't exist.
-=method remove_package_symbol $variable
+=method remove_symbol $variable
Removes the package variable described by C<$variable> (which includes the
sigil); other variables with the same name but different sigils will be
untouched.
-=method list_all_package_symbols $type_filter
+=method list_all_symbols $type_filter
Returns a list of package variable names in the package, without sigils. If a
C<type_filter> is passed, it is used to select package variables of a given