my @arr = qw(book dog cat); s/.*/'$_'/ for @arr; print "[" . join(',', @arr) . "];\n";