Attribute-Handlers

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

  - reduce how much code is in a string eval, to make debugging simpler

1.02 2022-02-25 (perl core only)
  - fix __CALLER__ handling in Attribute::Handlers
  - wrap any existing import in the Attribute::Handlers import

1.01 2017-09-12 (perl core only)
  - replace "use vars" with "our" variables

1.00 2016-01-18 (perl core only)
  - remove deprecated no-op :unique and :locked attributes

0.99 Fri Jul 24 18:44:48 EDT 2015
  - CPAN release of v0.97 code

0.97  Sun Jun  1 12:00:00 GMT 2015
  - fixes to deal with CVs without GVs

0.96  Fri Mar  7 08:30:00 CET 2014
  - Documentation fixes
  - Replace use of base.pm with parent.pm

lib/Attribute/Handlers.pm  view on Meta::CPAN

sub AUTOLOAD {
	return if $AUTOLOAD =~ /::DESTROY$/;
	my ($class) = $AUTOLOAD =~ m/(.*)::/g;
	$AUTOLOAD =~ m/_ATTR_(.*?)_(.*)/ or
	    croak "Can't locate class method '$AUTOLOAD' via package '$class'";
	croak "Attribute handler '$2' doesn't handle $1 attributes";
}

my $builtin = $] ge '5.027000'
    ? qr/lvalue|method|shared/
    : qr/lvalue|method|locked|shared|unique/;

sub _gen_handler_AH_() {
	return sub {
	    _resolve_lastattr if _delayed_name_resolution;
	    my ($pkg, $ref, @attrs) = @_;
	    my (undef, $filename, $linenum) = caller 2;
	    foreach (@attrs) {
		my ($attr, $data) = /^([a-z_]\w*)(?:[(](.*)[)])?$/is or next;
		if ($attr eq 'ATTR') {
			no strict 'refs';



( run in 0.378 second using v1.01-cache-2.11-cpan-4ee56698ea0 )