in reply to Re: Code Explanation
in thread Code Explanation
$p_str = join ",",'?'x@array;
Sandy's explanation is almost correct. The problem is that in the OP, there are parentheses around the '?' string. Those parentheses matter, because they cause the x operator to act on a list instead of a scalar. So actually, it's more like
my @array = qw(a b c); my @tmp = ('?') x @array; # @tmp now contains ('?', '?', '?') my $p_str = join ",", @tmp; # $p_str now contains '?,?,?'
|
|---|