On Mon, 27 Aug 2001, schwern@pobox.com wrote: > On Mon, Aug 27, 2001 at 10:29:46AM -0500, Ren Maddox wrote: >> The documentation of qw// states that a list is created. It needs >> to be reworded in terms of context. Here's one attempt: > > > >> qw/STRING/ >> >> Evaluates to a sequence of comma-separated, >> single-quoted sub-strings extracted out of STRING, >> using embedded whitespace as the delimiters. > > I'm with Ronald. The original description was better. Yes -- I'm not happy with this sentence either. I was hoping for some discussion of improvements. >> In list context, it can be understood as being >> roughly equivalent to: >> >> split(' ', q/STRING/, -1); >> >> the difference being that it happens at compile >> time. >> >> In scalar context, it evaluates to the final >> sub-string of the sequence. > > That's actually what a list does in scalar context (as opposed to an > array, which returns it's number of elements.) Commonly confused. > The clarification is good, especially since split() doesn't behave > that way. Except that the original point of this change is that there is no such thing as a list in scalar context. -- Ren Maddox ren@tivoli.comThread Previous | Thread Next