miguelele has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I need to pass a perl array, converted to a string list, to a block of JavaScript in a TT Template, to create a JavaScript array
If I use $string_to_feed_javascript = join (", ", @perl_array);$string_to_feed_javascript contains all items separated by commas, but this breaks JavaScript syntax because each alphanumeric value must be enclosed by quotes./p>
So How can I convert the array to a string this way?
Thank you in advance
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Array to list with quoted items
by repellent (Priest) on Jan 15, 2012 at 19:57 UTC | |
|
Re: Array to list with quoted items
by johngg (Canon) on Jan 15, 2012 at 21:56 UTC | |
|
Re: Array to list with quoted items
by BrowserUk (Patriarch) on Jan 15, 2012 at 19:30 UTC | |
by miguelele (Beadle) on Jan 15, 2012 at 21:27 UTC | |
|
Re: Array to list with quoted items
by JavaFan (Canon) on Jan 15, 2012 at 21:15 UTC |