Book HomeJava and XSLTSearch this book

8.228. UNIVERSAL

Base class; all blessed references inherit from it:

$sub = $obj->can('print');

$yes = UNIVERSAL::isa($ref, "HASH");

Provides the following methods.

can

$sub = $obj->can(method)

Checks if object $objhas a method method. If so, returns a reference to the subroutine; otherwise, returns undef. Can be called as a static or object method call, or as a subroutine:

$ref = UNIVERSAL::can(val, method)

Returns a reference to the subroutine if val is a blessed reference with a method method, and undef if val is not blessed or does not have method.

isa

$io = $fd->isa(type)

Returns true if the reference is blessed into package type or inherits from that package. Can be called as a static or object method call, or as a subroutine:

UNIVERSAL::isa(val, type)

Returns true if the first argument is a reference and either of the following is true:

VERSION

VERSION([require])

Returns the value of the variable $VERSION in the package the object is blessed into. With require specified, VERSION dies if the version of the package is not equal to or greater than the version specified in require. Can be called as either a static or object method call.



Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.