A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://perldoc.perl.org/functions/bless below:

bless - Perldoc Browser

bless tells Perl to mark the item referred to by REF as an object in a package. The two-argument version of bless is always preferable unless there is a specific reason to not use it.

See perlobj for more about the blessing (and blessings) of objects.

bless returns its first argument, the supplied reference, as the value of the function; since bless is commonly the last thing executed in constructors, this means that the reference to the object is returned as the constructor's value and allows the caller to immediately use this returned object in method calls.

CLASSNAME should always be a mixed-case name, as all-uppercase and all-lowercase names are meant to be used only for Perl builtin types and pragmas, respectively. Avoid creating all-uppercase or all-lowercase package names to prevent confusion.

Also avoid blessing things into the class name 0; this will cause code which (erroneously) checks the result of ref to see if a reference is blessed to fail, as "0", a false value, is returned.

See "Perl Modules" in perlmod for more details.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4