in reply to Array to list with quoted items

You may have heard of JSON?

useJSON::XS;
my $string_to_feed_javascript = encode_json \@perl_array; print $string_to_feed_javascript; # string is UTF-8 encoded