Upgrade to Devel::PPPort 3.14
[p5sagit/p5-mst-13.2.git] / pod / perlobj.pod
index ad99627..b0592ff 100644 (file)
@@ -151,8 +151,9 @@ There is a special array within each package called @ISA, which says
 where else to look for a method if you can't find it in the current
 package.  This is how Perl implements inheritance.  Each element of the
 @ISA array is just the name of another package that happens to be a
-class package.  The classes are searched (depth first) for missing
-methods in the order that they occur in @ISA.  The classes accessible
+class package.  The classes are searched for missing methods in
+depth-first, left-to-right order by default (see L<mro> for alternative
+search order and other in-depth information).  The classes accessible
 through @ISA are known as base classes of the current class.
 
 All classes implicitly inherit from class C<UNIVERSAL> as their
@@ -308,6 +309,10 @@ and so is the following:
 
     my $fred = (reverse "rettirC")->find(reverse "derF");
 
+The right side of the arrow typically is the method name, but a simple 
+scalar variable containing either the method name or a subroutine 
+reference can also be used.
+
 =head2 Indirect Object Syntax
 X<indirect object syntax> X<invocation, indirect> X<indirect>
 
@@ -402,6 +407,13 @@ X<invocant> X<blessed>
 C<blessed> returns the name of the package the argument has been
 blessed into, or C<undef>.
 
+=item DOES(ROLE)
+
+C<DOES> returns I<true> if its object claims to perform the role C<ROLE>.
+
+By default, the response to C<DOES> is the same as the response to ISA.  For
+more information on C<DOES> and other universal methods, see L<UNIVERSAL>.
+
 =item can(METHOD)
 X<can>
 
@@ -452,6 +464,11 @@ manipulating C<$_[0]> within the destructor.  The object itself (i.e.
 the thingy the reference points to, namely C<${$_[0]}>, C<@{$_[0]}>, 
 C<%{$_[0]}> etc.) is not similarly constrained.
 
+Since DESTROY methods can be called at unpredictable times, it is
+important that you localise any global variables that the method may
+update.  In particular, localise C<$@> if you use C<eval {}> and
+localise C<$?> if you use C<system> or backticks.
+
 If you arrange to re-bless the reference before the destructor returns,
 perl will again call the DESTROY method for the re-blessed object after
 the current one returns.  This can be used for clean delegation of