join takes two parameters, the 1st being a deliminator, and the next is a list of items to be joined together, using the deliminator as the glue
So...
@array = qw(one two three);
$p_str=join ",",@array;
would set $p_str to one,two,three
But, your sample code has an extra little something... the list of items is ('?')x@array.
The x after a string ('?' in this case) is an operator that says, repeat this string x number of times, where x is the number following it.
So what is x? It is @array, and since this is in scalar context (Perl knows that it is supposed to supply a number not a list), @array returns the number of elements within the array.
so...
@array = qw(one two three);
$p_str = '?'x@array;
sets $p_str to '???'
Finally,
@array = qw(one two three);
$p_str = join ",",'?'x@array;
is equivalent to...
@array = qw(one two three);
$p_str = join ",","???";
which simply joins the items ??? (note that there is only one item) together with commas.
Since there is only one item, there is no comma, and the final result is:
???
|