No intermediate array here.
johngg@aleatico:~$ perl -Mstrict -Mwarnings -E 'say q{}; my $str = q{+book +dog +cat}; say join q{, }, map { q{"} . $_ . q{"} } split m{\s+}, $str;' "+book", "+dog", "+cat"
I hope this is helpful.
Cheers,
JohnGG
In reply to Re: joining string content
by johngg
in thread joining string content
by joyfedl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |