in reply to map array elements with single quotes
Is map() suggestible or any other way to do it ...
map may or may not be suggestible, but it is dispensable. Since single-quotes are already being used when initializing the array, why not something like (although this won't work with "The People's Republic of China" – embedded whitespace):
>perl -wMstrict -le "my @foo = qw('usa' 'canada' 'strawberry'); print join ',', @foo; " 'usa','canada','strawberry'
Maybe getting rid of map was not the point, but it is another way!
|
|---|