in reply to Re: Re: storing all type of vars
in thread storing all type of vars
Only if you define "a list" as being something rather specific that doesn't match many, many uses of the term "list" in even just the standard *.pod documentation.
Some argue that you can't "evaluate a list in a scalar context" because the scalar context prevents the creation of the list in the first place (clearly they have a different, specific definition of the term "list" in mind when they say this). Some argue that there is no general rule about what you get when you evaluate a list in a scalar context: you could get the last element, a count of elements, the first element, or something else entirely. This fits a bit closer to my thinking on the matter.
I prefer to be very careful and say that evaluting "something that would return a list if used in a list context" in a scalar context may get you any number of things. One of the most common is the last element of the list.
I also feel that the term "list" is used to mean so many different things in so many different standard texts on Perl that saying anything definitive about "a list" without first carefully defining what "a list" means to you (at that moment) is likely to be an incorrect or at least overbroad statement.
- tye (but my friends call me "Tye")
|
|---|