>>>>> "Peter" == Peter Cline <[EMAIL PROTECTED]> writes:
Peter> Interestingly, saying
Peter> print my $number_of_elems = qw(a b c d);
Peter> outputs 4 and not d.
Peter> does qw turn the list into an array?
No. qw(a b c d) prior to 5.6 is defined as split ' ', q(a b c d);
split in a scalar context returns number of elements, and assigns
the split to @_. Had you had warnings on, you'd see that.
qw(a b c d) in 5.6 and later is defined as ('a', 'b', 'c', 'd'), so
you get the value 'd'. "Feh!" to backward compatibility, they
apparently screamed. :)
Hence, Template Toolkit broke in 5.5 because Perrin had done:
my $value = qw(xyz);
to parallel his
my @values = qw(abc def ghi);
above and below. For which us 5.5'ers only got 1, not xyz. :)
I've since beaten him over the head enough times to just use:
my $value = q(xyz);
which works just fine.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!