Jump to content

Perl Programming/Keywords/bless

From Wikibooks, open books for an open world
Previous: binmode Keywords Next: break

The bless keyword

[edit | edit source]

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

[edit | edit source]
  bless REFERENCE, CLASSNAME
  bless REFERENCE
Previous: binmode Keywords Next: break