can
$sub= $obj->can(method)
- Checks if object $obj has a method method. If so, returns a reference to the subroutine, otherwise returns
undef. Can be called as either a static or object method call, or as a subroutine:
$ref = UNIVERSAL::can(val, method)
Returns a reference to the subroutine ifvalis a blessed reference with a methodmethod, andundefifvalis not blessed or does not havemethod.