If you don't provide your own can() method, UNIVERSAL::can is used by default. You don't need to explicitly specify UNIVERSAL, because UNIVERSAL is the base class for all objects, and can() is in UNIVERSAL by default.
see UNIVERSAL
update: fixed link
| [reply] |
See also perltoot:
"UNIVERSAL: The Root of All Objects
Wouldn't it be convenient if all objects were rooted at some ultimate base class? That way you could give every object common methods without having to go and add it to each and every @ISA. Well, it turns out that you can. You don't see it, but Perl tacitly and irrevocably assumes that there's an extra element at the end of @ISA: the class UNIVERSAL. In version 5.003, there were no predefined methods there, but you could put whatever you felt like into it.
However, as of version 5.004 (or some subversive releases, like 5.003_08), UNIVERSAL has some methods in it already. These are builtin to your Perl binary, so they don't take any extra time to load. Predefined methods include isa(), can(), and VERSION(). isa() tells you whether an object or class ``is'' another one without having to traverse the hierarchy yourself:......" | [reply] |
To expand on what others have said, the provided UNIVERSAL methods are compiled in; you don't need to use UNIVERSAL; to get them. UNVERSAL.pm is provided just for those that wish to import them. | [reply] [d/l] |