Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There is also a concept of "context" in Perl.

An operation may be evaluated in list or scalar context. For example, if you evaluate an array in list context, you get the members of the array, however, in scalar context, you get the number of elements in the array.

This idea is generalized to discuss different evaluation contexts for scalars. You might hear people discussing how a value behaves in boolean or string context. It's also common to talk about casting as "-ification", for example casting something to boolean context is "boolification".

By default, undefined values convert to empty string and 0. However, this can be made to generate a warning or even a fatal exception by setting the appropriate pragmas.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: