diff options
author | David Wheeler <david@wheeler.net> | 2009-06-11 09:33:35 +0200 |
---|---|---|
committer | Steffen Mueller <smueller@cpan.org> | 2009-06-11 09:33:35 +0200 |
commit | f2e81f84c325cbe2d33e0d7e73bb3ff32cb94dc0 (patch) | |
tree | a14cf5d3be7d52a992b59ed3769e9bc63dafeb24 /ext/Attribute-Handlers | |
parent | 0b99e9860ee94a7d55fe93fe492e8286fdfa409d (diff) | |
download | perl-f2e81f84c325cbe2d33e0d7e73bb3ff32cb94dc0.tar.gz |
Document findsym in Attribute::Handlers
Also removes unused variable $found. Bumps Attribute::Handlers version
to 0.85.
Diffstat (limited to 'ext/Attribute-Handlers')
-rw-r--r-- | ext/Attribute-Handlers/Changes | 4 | ||||
-rw-r--r-- | ext/Attribute-Handlers/lib/Attribute/Handlers.pm | 25 |
2 files changed, 25 insertions, 4 deletions
diff --git a/ext/Attribute-Handlers/Changes b/ext/Attribute-Handlers/Changes index f1747e80fc..07e04c81f8 100644 --- a/ext/Attribute-Handlers/Changes +++ b/ext/Attribute-Handlers/Changes @@ -124,3 +124,7 @@ Revision history for Perl extension Attribute-Handlers 0.84 Wed Jun 10 15:14:00 CET 2009 - Core-CPAN synchronization + +0.85 Thu Jun 11 09:31:00 CET 2009 + - Document findsym for the sake of mod_perl. (David Wheeler) + - Remove unused variable. (David Wheeler) diff --git a/ext/Attribute-Handlers/lib/Attribute/Handlers.pm b/ext/Attribute-Handlers/lib/Attribute/Handlers.pm index ea6b326b65..bdf11b3877 100644 --- a/ext/Attribute-Handlers/lib/Attribute/Handlers.pm +++ b/ext/Attribute-Handlers/lib/Attribute/Handlers.pm @@ -4,7 +4,7 @@ use Carp; use warnings; use strict; use vars qw($VERSION $AUTOLOAD); -$VERSION = '0.84'; # remember to update version in POD! +$VERSION = '0.85'; # remember to update version in POD! # $DB::single=1; my %symcache; @@ -12,7 +12,6 @@ sub findsym { my ($pkg, $ref, $type) = @_; return $symcache{$pkg,$ref} if $symcache{$pkg,$ref}; $type ||= ref($ref); - my $found; no strict 'refs'; foreach my $sym ( values %{$pkg."::"} ) { use strict; @@ -234,8 +233,8 @@ Attribute::Handlers - Simpler definition of attribute handlers =head1 VERSION -This document describes version 0.84 of Attribute::Handlers, -released June 10, 2009. +This document describes version 0.85 of Attribute::Handlers, +released June 11, 2009. =head1 SYNOPSIS @@ -811,6 +810,24 @@ Let's you write: # etc. +=head1 UTILITY FUNCTIONS + +This module offers a single utility function, C<findsym()>. + +=over 4 + +=item findsym + + my $symbol = Attribute::Handlers::findsym($package, $referent); + +The function looks in the symbol table of C<$package> for the typeglob for +C<$referent>, which is a reference to a variable or subroutine (SCALAR, ARRAY, +HASH, or CODE). If it finds the typeglob, it returns it. Otherwise, it returns +undef. Note that C<findsym> memoizes the typeglobs it has previously +successfully found, so subsequent calls with the same arguments should be +must faster. + +=back =head1 DIAGNOSTICS |