|
|
| more useful options | |
| PerlMonks |
Re: Array qw differenceby davido (Cardinal) |
| on Nov 30, 2021 at 16:21 UTC ( [id://11139273]=note: print w/replies, xml ) | Need Help?? |
|
The qw// operator is discussed in perlop. The semantics are essentially that within a qw quote-like operator, whitespace separates elements. So: qw{ABCGE ABCGE} represents two elements, not one. This is different behavior from q// or qq//, which would return a single element:
Therefore, these two things ARE equivalent:
And these are equivalent:
And the following produces four elements: my @list = ('ABCDE', qw{DEFGH IJKLM}, 'NOPQR'); # Four elements.Dave
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||