From 988beb418b12b8cc4821055d79361f807c98aa36 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 15 Jun 2010 19:11:16 -0500 Subject: updated dzil stuff --- lib/Package/Stash.pm | 78 +++++++++------------------------------------------- 1 file changed, 13 insertions(+), 65 deletions(-) (limited to 'lib/Package/Stash.pm') diff --git a/lib/Package/Stash.pm b/lib/Package/Stash.pm index 6396ed5..ddc158b 100644 --- a/lib/Package/Stash.pm +++ b/lib/Package/Stash.pm @@ -1,14 +1,11 @@ package Package::Stash; use strict; use warnings; +# ABSTRACT: routines for manipulating stashes use Carp qw(confess); use Scalar::Util qw(reftype); -=head1 NAME - -Package::Stash - routines for manipulating stashes - =head1 SYNOPSIS my $stash = Package::Stash->new('Foo'); @@ -27,11 +24,7 @@ simple API. NOTE: Most methods in this class require a variable specification that includes a sigil. If this sigil is absent, it is assumed to represent the IO slot. -=head1 METHODS - -=cut - -=head2 new $package_name +=method new $package_name Creates a new C object, for the package given as the only argument. @@ -44,7 +37,7 @@ sub new { return bless { 'package' => $namespace }, $class; } -=head2 name +=method name Returns the name of the package that this object represents. @@ -54,7 +47,7 @@ sub name { return $_[0]->{package}; } -=head2 namespace +=method namespace Returns the raw stash itself. @@ -98,7 +91,7 @@ sub namespace { } } -=head2 add_package_symbol $variable $value %opts +=method add_package_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 @@ -172,7 +165,7 @@ sub add_package_symbol { *{$pkg . '::' . $name} = ref $initial_value ? $initial_value : \$initial_value; } -=head2 remove_package_glob $name +=method remove_package_glob $name Removes all package variables with the given name, regardless of sigil. @@ -186,7 +179,7 @@ sub remove_package_glob { # ... these functions deal with stuff on the namespace level -=head2 has_package_symbol $variable +=method has_package_symbol $variable Returns whether or not the given package variable (including sigil) exists. @@ -219,7 +212,7 @@ sub has_package_symbol { } } -=head2 get_package_symbol $variable +=method get_package_symbol $variable Returns the value of the given package variable (including sigil). @@ -269,7 +262,7 @@ sub get_package_symbol { } } -=head2 get_or_add_package_symbol $variable +=method get_or_add_package_symbol $variable Like C, except that it will return an empty hashref or arrayref if the variable doesn't exist. @@ -281,7 +274,7 @@ sub get_or_add_package_symbol { $self->get_package_symbol(@_, vivify => 1); } -=head2 remove_package_symbol $variable +=method remove_package_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 @@ -352,7 +345,7 @@ sub remove_package_symbol { $self->add_package_symbol($io_desc => $io) if defined $io; } -=head2 list_all_package_symbols $type_filter +=method list_all_package_symbols $type_filter Returns a list of package variable names in the package, without sigils. If a C is passed, it is used to select package variables of a given @@ -382,61 +375,16 @@ sub list_all_package_symbols { } } -=head1 BUGS - -No known bugs. - -Please report any bugs through RT: email -C, or browse to -L. - =head1 SEE ALSO -L - this module is a factoring out of code that used to -live here - -=head1 SUPPORT - -You can find this documentation for this module with the perldoc command. - - perldoc Package::Stash - -You can also look for information at: - =over 4 -=item * AnnoCPAN: Annotated CPAN documentation +=item * L -L - -=item * CPAN Ratings - -L - -=item * RT: CPAN's request tracker - -L - -=item * Search CPAN - -L +This module is a factoring out of code that used to live here =back -=head1 AUTHOR - - Jesse Luehrs - -Mostly copied from code from L, by Stevan Little and the -Moose Cabal. - -=head1 COPYRIGHT AND LICENSE - -This software is copyright (c) 2010 by Jesse Luehrs. - -This is free software; you can redistribute it and/or modify it under -the same terms as perl itself. - =cut 1; -- cgit v1.2.3-54-g00ecf