Here is the documentation for map from 'perldoc -f map':
map BLOCK LIST
map EXPR,LIST
Evaluates the BLOCK or EXPR for each element of LIST (locally setting $_ to each element) and returns the list value composed of the results of each such evaluation.
In your case, BLOCK is
{ $_=~ s/"/'/g; ""$_"" }
and LIST is @data. Therefore, each element of @data is aliased to $_, the substitution s//"/'/g is performed on it, which changes all double-quote characters to single-quote apostrophes, Then, the second 'line' of the BLOCK is evaluated and pushed onto the result list, which puts the transformed string between double-quotes. The resulting list is joined with '.' characters and printed to the OUT2 file stream.