Re: Constant attributes

[email protected] (Bernardo Rechea)
Newsgroups perl.moose
Message-ID <[email protected]>
Chris Prather wrote:

> which can also be written:
> 
> sub needs_trinket () { 0 }
> and
> sub needs_trinket () { 1 }
> 
> perl optimizes things with empty prototypes that return a constant.

That's quite a wonderful bit of arcana. At least for me: I don't use
prototypes, so I never paid much attention to the prototypes section in the
camel book.

Bernardo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.