Hello theleftright,
Other monks have addressed your question. I just want to point out that the qw operator, which the Camel Book calls the “quote words” construct,1 creates a list of words and stringifies (quotes) each word for you. So this:
use strict;
use warnings;
use Data::Dump;
my @array = qw("this" "xxx" "is" not "xxx" and "xxx" "whatever");
dd \@array;
produces this:
13:57 >perl 1497_SoPW.pl
[
"\"this\"",
"\"xxx\"",
"\"is\"",
"not",
"\"xxx\"",
"and",
"\"xxx\"",
"\"whatever\"",
]
13:58 >
which shows that the quote characters in your original list have been retained as part of the data. Probably not what you intended?
This makes no difference to the outcome of the code in this particular example, but is something you should be aware of in your general programming.
1Programming Perl, 4th Edition, p. 72.
Hope that helps,
|