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. > 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. -- Michael G. Schwern <schwern@pobox.com> http://www.pobox.com/~schwern/ Perl6 Quality Assurance <perl-qa@perl.org> Kwalitee Is Job One We can also varify who belongs in the Kingdom of God and who doesn't with other source of available personal records and by the will of family members. --Alex Chiu, Immortality GuyThread Previous | Thread Next