The concatenation operator (.) is documented in perlop. It evaluates its operands in scalar context, stringifies and concatenates what the operands returned, then returns the result of the concatenation. In scalar context, @array evaluates to the number of elements in the array.
$ perl -we'my @a=qw( a b c ); my $x = @a . "\n"; print $x' | od -c
0000000 3 \n
0000002
@array "\n" is not valid Perl. Below, I'll talk about @array, "\n" in case that's what you meant.
$ perl -we'my @a=qw( a b c ); my $x = @a "\n";'
String found where operator expected at -e line 1, near "@a "\n""
(Missing operator before "\n"?)
syntax error at -e line 1, near "@a "\n""
Execution of -e aborted due to compilation errors.
In scalar context, the list operator aka comma operator executes all but the last of its operands in turn (sometimes in void context, sometimes in scalar context) and discards what they return. It then executes that last operand and returns the result. In this case, this would mean that @array returns the number of elements it contains, that would get discarded, then it returns "\n".
$ perl -we'my @a=qw( a b c ); my $x = (@a, "\n"); print $x' | od -c
Useless use of private array in void context at -e line 1.
0000000 \n
0000001
In list context, the list operator aka comma operator executes all of its operands in turn (in list context) and forms a list from the values they return. That list is then returned. In this case, this would mean that @array returns all of its elements. A value of "\n" is appended to that list, then the whole list is returned.
$ perl -we'my @a=qw( a b c ); my @x = (@a, "\n"); print "[$_]" for @x'
+ | od -c
0000000 [ a ] [ b ] [ c ] [ \n ]
0000014
My understanding is just that . is used to match single characters in regex.
Regex patterns have their own syntax.
|