1 package Attribute::Handlers;
6 use vars qw($VERSION $AUTOLOAD);
12 my ($pkg, $ref, $type) = @_;
13 return $symcache{$pkg,$ref} if $symcache{$pkg,$ref};
17 foreach my $sym ( values %{$pkg."::"} ) {
19 return $symcache{$pkg,$ref} = \$sym
20 if *{$sym}{$type} && *{$sym}{$type} == $ref;
25 VAR => [qw[SCALAR ARRAY HASH]],
26 ANY => [qw[SCALAR ARRAY HASH CODE]],
27 "" => [qw[SCALAR ARRAY HASH CODE]],
28 SCALAR => [qw[SCALAR]],
37 my %sigil = (SCALAR=>'$', ARRAY=>'@', HASH=>'%');
45 my @global_phases = qw(BEGIN CHECK INIT END);
48 croak "Usage: use $_[0] autotie => {AttrName => TieClassName,...}";
51 my $qual_id = qr/^[_a-z]\w*(::[_a-z]\w*)*$/i;
55 return unless $class eq "Attribute::Handlers";
58 if ($cmd =~ /^autotie((?:ref)?)$/) {
59 my $tiedata = ($1 ? '$ref, ' : '') . '@$data';
61 _usage_AH_ $class unless ref($mapping) eq 'HASH';
62 while (my($attr, $tieclass) = each %$mapping) {
63 $tieclass =~ s/^([_a-z]\w*(::[_a-z]\w*)*)(.*)/$1/is;
65 _usage_AH_ $class unless $attr =~ $qual_id
66 && $tieclass =~ $qual_id
67 && eval "use base q\0$tieclass\0; 1";
68 if ($tieclass->isa('Exporter')) {
69 local $Exporter::ExportLevel = 2;
70 $tieclass->import(eval $args);
72 $attr =~ s/__CALLER__/caller(1)/e;
73 $attr = caller()."::".$attr unless $attr =~ /::/;
75 sub $attr : ATTR(VAR) {
76 my (\$ref, \$data) = \@_[2,4];
77 my \$was_arrayref = ref \$data eq 'ARRAY';
78 \$data = [ \$data ] unless \$was_arrayref;
79 my \$type = ref(\$ref)||"value (".(\$ref||"<undef>").")";
80 (\$type eq 'SCALAR')? tie \$\$ref,'$tieclass',$tiedata
81 :(\$type eq 'ARRAY') ? tie \@\$ref,'$tieclass',$tiedata
82 :(\$type eq 'HASH') ? tie \%\$ref,'$tieclass',$tiedata
83 : die "Can't autotie a \$type\n"
85 } or die "Internal error: $@";
89 croak "Can't understand $_";
93 sub _resolve_lastattr {
94 return unless $lastattr{ref};
95 my $sym = findsym @lastattr{'pkg','ref'}
96 or die "Internal error: $lastattr{pkg} symbol went missing";
97 my $name = *{$sym}{NAME};
98 warn "Declaration of $name attribute in package $lastattr{pkg} may clash with future reserved word\n"
99 if $^W and $name !~ /[A-Z]/;
100 foreach ( @{$validtype{$lastattr{type}}} ) {
102 *{"$lastattr{pkg}::_ATTR_${_}_${name}"} = $lastattr{ref};
108 return if $AUTOLOAD =~ /::DESTROY$/;
109 my ($class) = $AUTOLOAD =~ m/(.*)::/g;
110 $AUTOLOAD =~ m/_ATTR_(.*?)_(.*)/ or
111 croak "Can't locate class method '$AUTOLOAD' via package '$class'";
112 croak "Attribute handler '$2' doesn't handle $1 attributes";
115 my $builtin = qr/lvalue|method|locked|unique|shared/;
117 sub _gen_handler_AH_() {
120 my ($pkg, $ref, @attrs) = @_;
121 my (undef, $filename, $linenum) = caller 2;
123 my ($attr, $data) = /^([a-z_]\w*)(?:[(](.*)[)])?$/is or next;
124 if ($attr eq 'ATTR') {
127 $raw{$ref} = $data =~ s/\s*,?\s*RAWDATA\s*,?\s*//;
128 $phase{$ref}{BEGIN} = 1
129 if $data =~ s/\s*,?\s*(BEGIN)\s*,?\s*//;
130 $phase{$ref}{INIT} = 1
131 if $data =~ s/\s*,?\s*(INIT)\s*,?\s*//;
132 $phase{$ref}{END} = 1
133 if $data =~ s/\s*,?\s*(END)\s*,?\s*//;
134 $phase{$ref}{CHECK} = 1
135 if $data =~ s/\s*,?\s*(CHECK)\s*,?\s*//
136 || ! keys %{$phase{$ref}};
137 # Added for cleanup to not pollute next call.
139 croak "Can't have two ATTR specifiers on one subroutine"
141 croak "Bad attribute type: ATTR($data)"
142 unless $validtype{$data};
143 %lastattr=(pkg=>$pkg,ref=>$ref,type=>$data);
147 my $handler = $pkg->can("_ATTR_${type}_${attr}");
148 next unless $handler;
149 my $decl = [$pkg, $ref, $attr, $data,
150 $raw{$handler}, $phase{$handler}, $filename, $linenum];
151 foreach my $gphase (@global_phases) {
152 _apply_handler_AH_($decl,$gphase)
153 if $global_phases{$gphase} <= $global_phase;
155 if ($global_phase != 0) {
156 # if _gen_handler_AH_ is being called after
157 # CHECK it's for a lexical, so make sure
158 # it didn't want to run anything later
160 local $Carp::CarpLevel = 2;
161 carp "Won't be able to apply END handler"
162 if $phase{$handler}{END};
165 push @declarations, $decl
170 return grep {defined && !/$builtin/} @attrs;
176 *{"Attribute::Handlers::UNIVERSAL::MODIFY_${_}_ATTRIBUTES"} =
177 _gen_handler_AH_ foreach @{$validtype{ANY}};
179 push @UNIVERSAL::ISA, 'Attribute::Handlers::UNIVERSAL'
180 unless grep /^Attribute::Handlers::UNIVERSAL$/, @UNIVERSAL::ISA;
182 sub _apply_handler_AH_ {
183 my ($declaration, $phase) = @_;
184 my ($pkg, $ref, $attr, $data, $raw, $handlerphase, $filename, $linenum) = @$declaration;
185 return unless $handlerphase->{$phase};
186 # print STDERR "Handling $attr on $ref in $phase with [$data]\n";
188 my $handler = "_ATTR_${type}_${attr}";
189 my $sym = findsym($pkg, $ref);
190 $sym ||= $type eq 'CODE' ? 'ANON' : 'LEXICAL';
192 my $evaled = !$raw && eval("package $pkg; no warnings;
193 local \$SIG{__WARN__}=sub{die}; [$data]");
194 $data = ($evaled && $data =~ /^\s*\[/) ? [$evaled]
195 : ($evaled) ? $evaled
198 (ref $sym eq 'GLOB' ? *{$sym}{ref $ref}||$ref : $ref),
200 (@$data>1? $data : $data->[0]),
213 _apply_handler_AH_($_,'CHECK') foreach @declarations;
218 _apply_handler_AH_($_,'INIT') foreach @declarations
222 END { $global_phase++; _apply_handler_AH_($_,'END') foreach @declarations }
229 Attribute::Handlers - Simpler definition of attribute handlers
233 This document describes version 0.78 of Attribute::Handlers,
234 released October 5, 2002.
240 use Attribute::Handlers;
241 no warnings 'redefine';
244 sub Good : ATTR(SCALAR) {
245 my ($package, $symbol, $referent, $attr, $data) = @_;
247 # Invoked for any scalar variable with a :Good attribute,
248 # provided the variable was declared in MyClass (or
249 # a derived class) or typed to MyClass.
251 # Do whatever to $referent here (executed in CHECK phase).
255 sub Bad : ATTR(SCALAR) {
256 # Invoked for any scalar variable with a :Bad attribute,
257 # provided the variable was declared in MyClass (or
258 # a derived class) or typed to MyClass.
262 sub Good : ATTR(ARRAY) {
263 # Invoked for any array variable with a :Good attribute,
264 # provided the variable was declared in MyClass (or
265 # a derived class) or typed to MyClass.
269 sub Good : ATTR(HASH) {
270 # Invoked for any hash variable with a :Good attribute,
271 # provided the variable was declared in MyClass (or
272 # a derived class) or typed to MyClass.
276 sub Ugly : ATTR(CODE) {
277 # Invoked for any subroutine declared in MyClass (or a
278 # derived class) with an :Ugly attribute.
283 # Invoked for any scalar, array, hash, or subroutine
284 # with an :Omni attribute, provided the variable or
285 # subroutine was declared in MyClass (or a derived class)
286 # or the variable was typed to MyClass.
287 # Use ref($_[2]) to determine what kind of referent it was.
292 use Attribute::Handlers autotie => { Cycle => Tie::Cycle };
294 my $next : Cycle(['A'..'Z']);
299 This module, when inherited by a package, allows that package's class to
300 define attribute handler subroutines for specific attributes. Variables
301 and subroutines subsequently defined in that package, or in packages
302 derived from that package may be given attributes with the same names as
303 the attribute handler subroutines, which will then be called in one of
304 the compilation phases (i.e. in a C<BEGIN>, C<CHECK>, C<INIT>, or C<END>
305 block). (C<UNITCHECK> blocks don't correspond to a global compilation
306 phase, so they can't be specified here.)
308 To create a handler, define it as a subroutine with the same name as
309 the desired attribute, and declare the subroutine itself with the
310 attribute C<:ATTR>. For example:
313 use Attribute::Handlers;
316 my ($package, $symbol, $referent, $attr, $data, $phase, $filename, $linenum) = @_;
319 *{$symbol}{NAME}, " ",
320 "($referent) ", "was just declared ",
321 "and ascribed the ${attr} attribute ",
322 "with data ($data)\n",
324 "in file $filename at line $linenum\n";
327 This creates a handler for the attribute C<:Loud> in the class LoudDecl.
328 Thereafter, any subroutine declared with a C<:Loud> attribute in the class
335 causes the above handler to be invoked, and passed:
341 the name of the package into which it was declared;
345 a reference to the symbol table entry (typeglob) containing the subroutine;
349 a reference to the subroutine;
353 the name of the attribute;
357 any data associated with that attribute;
361 the name of the phase in which the handler is being invoked;
365 the filename in which the handler is being invoked;
369 the line number in this file.
373 Likewise, declaring any variables with the C<:Loud> attribute within the
382 will cause the handler to be called with a similar argument list (except,
383 of course, that C<$_[2]> will be a reference to the variable).
385 The package name argument will typically be the name of the class into
386 which the subroutine was declared, but it may also be the name of a derived
387 class (since handlers are inherited).
389 If a lexical variable is given an attribute, there is no symbol table to
390 which it belongs, so the symbol table argument (C<$_[1]>) is set to the
391 string C<'LEXICAL'> in that case. Likewise, ascribing an attribute to
392 an anonymous subroutine results in a symbol table argument of C<'ANON'>.
394 The data argument passes in the value (if any) associated with the
395 attribute. For example, if C<&foo> had been declared:
397 sub foo :Loud("turn it up to 11, man!") {...}
399 then the string C<"turn it up to 11, man!"> would be passed as the
402 Attribute::Handlers makes strenuous efforts to convert
403 the data argument (C<$_[4]>) to a useable form before passing it to
404 the handler (but see L<"Non-interpretive attribute handlers">).
405 For example, all of these:
407 sub foo :Loud(till=>ears=>are=>bleeding) {...}
408 sub foo :Loud(['till','ears','are','bleeding']) {...}
409 sub foo :Loud(qw/till ears are bleeding/) {...}
410 sub foo :Loud(qw/my, ears, are, bleeding/) {...}
411 sub foo :Loud(till,ears,are,bleeding) {...}
413 causes it to pass C<['till','ears','are','bleeding']> as the handler's
414 data argument. However, if the data can't be parsed as valid Perl, then
415 it is passed as an uninterpreted string. For example:
417 sub foo :Loud(my,ears,are,bleeding) {...}
418 sub foo :Loud(qw/my ears are bleeding) {...}
420 cause the strings C<'my,ears,are,bleeding'> and C<'qw/my ears are bleeding'>
421 respectively to be passed as the data argument.
423 If the attribute has only a single associated scalar data value, that value is
424 passed as a scalar. If multiple values are associated, they are passed as an
425 array reference. If no value is associated with the attribute, C<undef> is
429 =head2 Typed lexicals
431 Regardless of the package in which it is declared, if a lexical variable is
432 ascribed an attribute, the handler that is invoked is the one belonging to
433 the package to which it is typed. For example, the following declarations:
437 my LoudDecl $loudobj : Loud;
438 my LoudDecl @loudobjs : Loud;
439 my LoudDecl %loudobjex : Loud;
441 causes the LoudDecl::Loud handler to be invoked (even if OtherClass also
442 defines a handler for C<:Loud> attributes).
445 =head2 Type-specific attribute handlers
447 If an attribute handler is declared and the C<:ATTR> specifier is
448 given the name of a built-in type (C<SCALAR>, C<ARRAY>, C<HASH>, or C<CODE>),
449 the handler is only applied to declarations of that type. For example,
450 the following definition:
454 sub RealLoud :ATTR(SCALAR) { print "Yeeeeow!" }
456 creates an attribute handler that applies only to scalars:
462 my $metal : RealLoud; # invokes &LoudDecl::RealLoud
463 my @metal : RealLoud; # error: unknown attribute
464 my %metal : RealLoud; # error: unknown attribute
465 sub metal : RealLoud {...} # error: unknown attribute
467 You can, of course, declare separate handlers for these types as well
468 (but you'll need to specify C<no warnings 'redefine'> to do it quietly):
471 use Attribute::Handlers;
472 no warnings 'redefine';
474 sub RealLoud :ATTR(SCALAR) { print "Yeeeeow!" }
475 sub RealLoud :ATTR(ARRAY) { print "Urrrrrrrrrr!" }
476 sub RealLoud :ATTR(HASH) { print "Arrrrrgggghhhhhh!" }
477 sub RealLoud :ATTR(CODE) { croak "Real loud sub torpedoed" }
479 You can also explicitly indicate that a single handler is meant to be
480 used for all types of referents like so:
483 use Attribute::Handlers;
485 sub SeriousLoud :ATTR(ANY) { warn "Hearing loss imminent" }
487 (I.e. C<ATTR(ANY)> is a synonym for C<:ATTR>).
490 =head2 Non-interpretive attribute handlers
492 Occasionally the strenuous efforts Attribute::Handlers makes to convert
493 the data argument (C<$_[4]>) to a useable form before passing it to
494 the handler get in the way.
496 You can turn off that eagerness-to-help by declaring
497 an attribute handler with the keyword C<RAWDATA>. For example:
499 sub Raw : ATTR(RAWDATA) {...}
500 sub Nekkid : ATTR(SCALAR,RAWDATA) {...}
501 sub Au::Naturale : ATTR(RAWDATA,ANY) {...}
503 Then the handler makes absolutely no attempt to interpret the data it
504 receives and simply passes it as a string:
506 my $power : Raw(1..100); # handlers receives "1..100"
508 =head2 Phase-specific attribute handlers
510 By default, attribute handlers are called at the end of the compilation
511 phase (in a C<CHECK> block). This seems to be optimal in most cases because
512 most things that can be defined are defined by that point but nothing has
515 However, it is possible to set up attribute handlers that are called at
516 other points in the program's compilation or execution, by explicitly
517 stating the phase (or phases) in which you wish the attribute handler to
518 be called. For example:
520 sub Early :ATTR(SCALAR,BEGIN) {...}
521 sub Normal :ATTR(SCALAR,CHECK) {...}
522 sub Late :ATTR(SCALAR,INIT) {...}
523 sub Final :ATTR(SCALAR,END) {...}
524 sub Bookends :ATTR(SCALAR,BEGIN,END) {...}
526 As the last example indicates, a handler may be set up to be (re)called in
527 two or more phases. The phase name is passed as the handler's final argument.
529 Note that attribute handlers that are scheduled for the C<BEGIN> phase
530 are handled as soon as the attribute is detected (i.e. before any
531 subsequently defined C<BEGIN> blocks are executed).
534 =head2 Attributes as C<tie> interfaces
536 Attributes make an excellent and intuitive interface through which to tie
537 variables. For example:
539 use Attribute::Handlers;
542 sub UNIVERSAL::Cycle : ATTR(SCALAR) {
543 my ($package, $symbol, $referent, $attr, $data, $phase) = @_;
544 $data = [ $data ] unless ref $data eq 'ARRAY';
545 tie $$referent, 'Tie::Cycle', $data;
552 my $next : Cycle('A'..'Z'); # $next is now a tied variable
558 Note that, because the C<Cycle> attribute receives its arguments in the
559 C<$data> variable, if the attribute is given a list of arguments, C<$data>
560 will consist of a single array reference; otherwise, it will consist of the
561 single argument directly. Since Tie::Cycle requires its cycling values to
562 be passed as an array reference, this means that we need to wrap
563 non-array-reference arguments in an array constructor:
565 $data = [ $data ] unless ref $data eq 'ARRAY';
567 Typically, however, things are the other way around: the tieable class expects
568 its arguments as a flattened list, so the attribute looks like:
570 sub UNIVERSAL::Cycle : ATTR(SCALAR) {
571 my ($package, $symbol, $referent, $attr, $data, $phase) = @_;
572 my @data = ref $data eq 'ARRAY' ? @$data : $data;
573 tie $$referent, 'Tie::Whatever', @data;
577 This software pattern is so widely applicable that Attribute::Handlers
578 provides a way to automate it: specifying C<'autotie'> in the
579 C<use Attribute::Handlers> statement. So, the cycling example,
580 could also be written:
582 use Attribute::Handlers autotie => { Cycle => 'Tie::Cycle' };
588 my $next : Cycle(['A'..'Z']); # $next is now a tied variable
593 Note that we now have to pass the cycling values as an array reference,
594 since the C<autotie> mechanism passes C<tie> a list of arguments as a list
595 (as in the Tie::Whatever example), I<not> as an array reference (as in
596 the original Tie::Cycle example at the start of this section).
598 The argument after C<'autotie'> is a reference to a hash in which each key is
599 the name of an attribute to be created, and each value is the class to which
600 variables ascribed that attribute should be tied.
602 Note that there is no longer any need to import the Tie::Cycle module --
603 Attribute::Handlers takes care of that automagically. You can even pass
604 arguments to the module's C<import> subroutine, by appending them to the
605 class name. For example:
607 use Attribute::Handlers
608 autotie => { Dir => 'Tie::Dir qw(DIR_UNLINK)' };
610 If the attribute name is unqualified, the attribute is installed in the
611 current package. Otherwise it is installed in the qualifier's package:
615 use Attribute::Handlers autotie => {
616 Other::Good => Tie::SecureHash, # tie attr installed in Other::
617 Bad => Tie::Taxes, # tie attr installed in Here::
618 UNIVERSAL::Ugly => Software::Patent # tie attr installed everywhere
621 Autoties are most commonly used in the module to which they actually tie,
622 and need to export their attributes to any module that calls them. To
623 facilitate this, Attribute::Handlers recognizes a special "pseudo-class" --
624 C<__CALLER__>, which may be specified as the qualifier of an attribute:
626 package Tie::Me::Kangaroo:Down::Sport;
628 use Attribute::Handlers autotie => { '__CALLER__::Roo' => __PACKAGE__ };
630 This causes Attribute::Handlers to define the C<Roo> attribute in the package
631 that imports the Tie::Me::Kangaroo:Down::Sport module.
633 Note that it is important to quote the __CALLER__::Roo identifier because
634 a bug in perl 5.8 will refuse to parse it and cause an unknown error.
636 =head3 Passing the tied object to C<tie>
638 Occasionally it is important to pass a reference to the object being tied
639 to the TIESCALAR, TIEHASH, etc. that ties it.
641 The C<autotie> mechanism supports this too. The following code:
643 use Attribute::Handlers autotieref => { Selfish => Tie::Selfish };
644 my $var : Selfish(@args);
646 has the same effect as:
648 tie my $var, 'Tie::Selfish', @args;
650 But when C<"autotieref"> is used instead of C<"autotie">:
652 use Attribute::Handlers autotieref => { Selfish => Tie::Selfish };
653 my $var : Selfish(@args);
655 the effect is to pass the C<tie> call an extra reference to the variable
658 tie my $var, 'Tie::Selfish', \$var, @args;
664 If the class shown in L<SYNOPSIS> were placed in the MyClass.pm
665 module, then the following code:
670 my MyClass $slr :Good :Bad(1**1-1) :Omni(-vorous);
672 package SomeOtherClass;
677 sub fn :Ugly(sister) :Omni('po',tent()) {...}
678 my @arr :Good :Omni(s/cie/nt/);
679 my %hsh :Good(q/bye) :Omni(q/bus/);
682 would cause the following handlers to be invoked:
684 # my MyClass $slr :Good :Bad(1**1-1) :Omni(-vorous);
686 MyClass::Good:ATTR(SCALAR)( 'MyClass', # class
687 'LEXICAL', # no typeglob
691 'CHECK', # compiler phase
694 MyClass::Bad:ATTR(SCALAR)( 'MyClass', # class
695 'LEXICAL', # no typeglob
699 'CHECK', # compiler phase
702 MyClass::Omni:ATTR(SCALAR)( 'MyClass', # class
703 'LEXICAL', # no typeglob
706 '-vorous' # eval'd attr data
707 'CHECK', # compiler phase
711 # sub fn :Ugly(sister) :Omni('po',tent()) {...}
713 MyClass::UGLY:ATTR(CODE)( 'SomeOtherClass', # class
714 \*SomeOtherClass::fn, # typeglob
715 \&SomeOtherClass::fn, # referent
717 'sister' # eval'd attr data
718 'CHECK', # compiler phase
721 MyClass::Omni:ATTR(CODE)( 'SomeOtherClass', # class
722 \*SomeOtherClass::fn, # typeglob
723 \&SomeOtherClass::fn, # referent
725 ['po','acle'] # eval'd attr data
726 'CHECK', # compiler phase
730 # my @arr :Good :Omni(s/cie/nt/);
732 MyClass::Good:ATTR(ARRAY)( 'SomeOtherClass', # class
733 'LEXICAL', # no typeglob
737 'CHECK', # compiler phase
740 MyClass::Omni:ATTR(ARRAY)( 'SomeOtherClass', # class
741 'LEXICAL', # no typeglob
744 "" # eval'd attr data
745 'CHECK', # compiler phase
749 # my %hsh :Good(q/bye) :Omni(q/bus/);
751 MyClass::Good:ATTR(HASH)( 'SomeOtherClass', # class
752 'LEXICAL', # no typeglob
755 'q/bye' # raw attr data
756 'CHECK', # compiler phase
759 MyClass::Omni:ATTR(HASH)( 'SomeOtherClass', # class
760 'LEXICAL', # no typeglob
763 'bus' # eval'd attr data
764 'CHECK', # compiler phase
768 Installing handlers into UNIVERSAL, makes them...err..universal.
771 package Descriptions;
772 use Attribute::Handlers;
775 sub name { return $name{$_[2]}||*{$_[1]}{NAME} }
777 sub UNIVERSAL::Name :ATTR {
778 $name{$_[2]} = $_[4];
781 sub UNIVERSAL::Purpose :ATTR {
782 print STDERR "Purpose of ", &name, " is $_[4]\n";
785 sub UNIVERSAL::Unit :ATTR {
786 print STDERR &name, " measured in $_[4]\n";
793 my $capacity : Name(capacity)
794 : Purpose(to store max storage capacity for files)
800 sub foo : Purpose(to foo all data before barring it) { }
809 =item C<Bad attribute type: ATTR(%s)>
811 An attribute handler was specified with an C<:ATTR(I<ref_type>)>, but the
812 type of referent it was defined to handle wasn't one of the five permitted:
813 C<SCALAR>, C<ARRAY>, C<HASH>, C<CODE>, or C<ANY>.
815 =item C<Attribute handler %s doesn't handle %s attributes>
817 A handler for attributes of the specified name I<was> defined, but not
818 for the specified type of declaration. Typically encountered whe trying
819 to apply a C<VAR> attribute handler to a subroutine, or a C<SCALAR>
820 attribute handler to some other type of variable.
822 =item C<Declaration of %s attribute in package %s may clash with future reserved word>
824 A handler for an attributes with an all-lowercase name was declared. An
825 attribute with an all-lowercase name might have a meaning to Perl
826 itself some day, even though most don't yet. Use a mixed-case attribute
829 =item C<Can't have two ATTR specifiers on one subroutine>
831 You just can't, okay?
832 Instead, put all the specifications together with commas between them
833 in a single C<ATTR(I<specification>)>.
835 =item C<Can't autotie a %s>
837 You can only declare autoties for types C<"SCALAR">, C<"ARRAY">, and
838 C<"HASH">. They're the only things (apart from typeglobs -- which are
839 not declarable) that Perl can tie.
841 =item C<Internal error: %s symbol went missing>
843 Something is rotten in the state of the program. An attributed
844 subroutine ceased to exist between the point it was declared and the point
845 at which its attribute handler(s) would have been called.
847 =item C<Won't be able to apply END handler>
849 You have defined an END handler for an attribute that is being applied
850 to a lexical variable. Since the variable may not be available during END
857 Damian Conway (damian@conway.org)
861 There are undoubtedly serious bugs lurking somewhere in code this funky :-)
862 Bug reports and other feedback are most welcome.
866 Copyright (c) 2001, Damian Conway. All Rights Reserved.
867 This module is free software. It may be used, redistributed
868 and/or modified under the same terms as Perl itself.