in reply to Return Value of List-Producing Elements in Scalar Context

merlyn posted an excellent node summarizing this statement. In it, you'll find that caller, in scalar context returns the package name. One useful item is localtime, which in scalar context returns a well formatted timestamp, while in list context returns individual portions of the date and time split out into individual elements. glob in scalar context returns the next item (you can repeat until it returns undef).

merlyn's list is here: On Scalar Context. It's very informative.


Dave

  • Comment on Re: Return Value of List-Producing Elements in Scalar Context