< Perl Programming < Keywords

The bless keyword

The bless function tells the thingy REFERENCEd that it is an object in the CLASSNAME package. Without the word CLASSNAME, the current package is understood.

As bless is often the last command in the constructor, it returns a reference to the object.

Syntax

  bless REFERENCE, CLASSNAME
  bless REFERENCE
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.