One of the most important concepts to understand in Perl programming is that of evaluation based on context. In Perl, an operation such as an assignment or function call can give two different results based on the context of the expression. You see, in Perl, every operation behavior depends on the context in which it is called. A classic example is when using the “localtime” function. In a scalar context, the “localtime” function returns the current date and time. However, in a list context the function returns a nine-element list as shown below.
Blog Archives
Search Blog Archives