|laziness, impatience, and hubris|
Re: Loading multiple identical variables in array with multiplication variableby LanX (Archbishop)
|on Sep 24, 2014 at 16:45 UTC||Need Help??|
Yes, surround the strings with parens to enforce list repetition ( vs string)
see perlop#Multiplicative-Operators "repetition operator" for details
Binary "x" is the repetition operator. In scalar context or if the left operand is not enclosed in parentheses, it returns a string consisting of the left operand repeated the number of times specified by the right operand. In list context, if the left operand is enclosed in parentheses or is a list formed by "qw/STRING/", it repeats the list. If the right operand is zero or negative, it returns an empty string or an empty list, depending on the context.
but I have to admit it sounds confusing ... :)
hmm should maybe be rephrased:
always a string in scalar context!
(addicted to the Perl Programming Language and ☆☆☆☆ :)