X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlobj.pod;h=c8b85b4b7dae2e87c654f6322307c121f03c7f89;hb=4fc194b2052979cb8d28873cf62c0ce84cd214f5;hp=1d13d90c9a269ac994e92301a926a02ca71cc74b;hpb=5f05dabc4054964aa3b10f44f8468547f051cdf8;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlobj.pod b/pod/perlobj.pod index 1d13d90..c8b85b4 100644 --- a/pod/perlobj.pod +++ b/pod/perlobj.pod @@ -281,7 +281,7 @@ are inherited by all other classes: =over 4 -=item isa ( CLASS ) +=item isa(CLASS) C returns I if its object is blessed into a sub-class of C @@ -294,40 +294,24 @@ allows the ability to check what a reference points to. Example ... } -=item can ( METHOD ) +=item can(METHOD) C checks to see if its object has a method called C, if it does then a reference to the sub is returned, if it does not then I is returned. -=item VERSION ( [ VERSION ] ) +=item VERSION( [NEED] ) -C returns the VERSION number of the class (package). If -an argument is given then it will check that the current version is not -less that the given argument. This method is normally called as a class -method. This method is also called when the C form of C is -used. +C returns the version number of the class (package). If the +NEED argument is given then it will check that the current version (as +defined by the $VERSION variable in the given package) not less than +NEED; it will die if this is not the case. This method is normally +called as a class method. This method is called automatically by the +C form of C. use A 1.2 qw(some imported subs); - - A->VERSION( 1.2 ); - -=item class () - -C returns the class name of its object. - -=item is_instance () - -C returns true if its object is an instance of some -class, false if its object is the class (package) itself. Example - - A->is_instance(); # False - - $var = 'A'; - $var->is_instance(); # False - - $ref = bless [], 'A'; - $ref->is_instance(); # True + # implies: + A->VERSION(1.2); =back @@ -336,6 +320,9 @@ C uses a very similar method and cache-ing strategy. This may cause strange effects if the Perl code dynamically changes @ISA in any package. You may add other methods to the UNIVERSAL class via Perl or XS code. +You do not need to C in order to make these methods +available to your program. This is necessary only if you wish to +have C available as a plain subroutine in the current package. =head2 Destructors